From 20693b96bddda69b7f86b8fae7d04f7f0be81bc6 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 2 May 2011 14:52:11 +0200 Subject: [PATCH 01/79] CONF: move OpenFOAM etc/apps -> etc/config - use standard *.sh, *.csh endings --- .gitignore | 2 -- bin/tools/foamConfigurePaths | 2 +- etc/aliases.csh | 2 +- etc/aliases.sh | 2 +- etc/bashrc | 4 ++-- etc/{apps/ensight/cshrc => config/ensight.csh} | 2 +- etc/{apps/ensight/bashrc => config/ensight.sh} | 2 +- etc/config/{compiler.csh-EXAMPLE => example/compiler.csh} | 4 ++-- etc/config/{compiler.sh-EXAMPLE => example/compiler.sh} | 4 ++-- etc/config/{openmpi.csh-EXAMPLE => example/openmpi.csh} | 4 ++-- etc/config/{openmpi.sh-EXAMPLE => example/openmpi.sh} | 4 ++-- .../cshrc-EXAMPLE => config/example/paraview.csh} | 8 ++++---- .../bashrc-EXAMPLE => config/example/paraview.sh} | 8 ++++---- etc/{apps/paraview3/cshrc => config/paraview.csh} | 2 +- etc/{apps/paraview3/bashrc => config/paraview.sh} | 3 +-- etc/{apps/scotch/bashrc => config/scotch.sh} | 3 +-- etc/cshrc | 4 ++-- src/parallel/decompose/Allwmake | 4 ++-- 18 files changed, 30 insertions(+), 34 deletions(-) rename etc/{apps/ensight/cshrc => config/ensight.csh} (98%) rename etc/{apps/ensight/bashrc => config/ensight.sh} (98%) rename etc/config/{compiler.csh-EXAMPLE => example/compiler.csh} (94%) rename etc/config/{compiler.sh-EXAMPLE => example/compiler.sh} (94%) rename etc/config/{openmpi.csh-EXAMPLE => example/openmpi.csh} (93%) rename etc/config/{openmpi.sh-EXAMPLE => example/openmpi.sh} (93%) rename etc/{apps/paraview3/cshrc-EXAMPLE => config/example/paraview.csh} (86%) rename etc/{apps/paraview3/bashrc-EXAMPLE => config/example/paraview.sh} (86%) rename etc/{apps/paraview3/cshrc => config/paraview.csh} (99%) rename etc/{apps/paraview3/bashrc => config/paraview.sh} (99%) rename etc/{apps/scotch/bashrc => config/scotch.sh} (98%) diff --git a/.gitignore b/.gitignore index e2c6f9b41f..1b8ce3cde3 100644 --- a/.gitignore +++ b/.gitignore @@ -60,8 +60,6 @@ doc/[Dd]oxygen/man # untracked configuration files /etc/prefs.csh /etc/prefs.sh -/etc/config/*.csh -/etc/config/*.sh # source packages - anywhere *.tar.bz2 diff --git a/bin/tools/foamConfigurePaths b/bin/tools/foamConfigurePaths index f3948c3cc2..9526748f07 100755 --- a/bin/tools/foamConfigurePaths +++ b/bin/tools/foamConfigurePaths @@ -131,7 +131,7 @@ do paraviewInstall="$2" # replace ParaView_DIR=... _inlineSed \ - etc/apps/paraview3/bashrc \ + etc/config/paraview.sh \ '/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" \ "Replacing ParaView_DIR setting by '$paraviewInstall'" shift 2 diff --git a/etc/aliases.csh b/etc/aliases.csh index 558390b403..5c5b344497 100644 --- a/etc/aliases.csh +++ b/etc/aliases.csh @@ -49,7 +49,7 @@ alias wmSchedOFF 'unsetenv WM_SCHEDULER' # Change ParaView version # ~~~~~~~~~~~~~~~~~~~~~~~ -alias foamPV 'source `$WM_PROJECT_DIR/etc/apps/paraview3/cshrc` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION' +alias foamPV 'source `$WM_PROJECT_DIR/etc/config/paraview.csh` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION' # Change directory aliases diff --git a/etc/aliases.sh b/etc/aliases.sh index e9c1227004..df0fda7389 100644 --- a/etc/aliases.sh +++ b/etc/aliases.sh @@ -52,7 +52,7 @@ alias wmSchedOFF='unset WM_SCHEDULER' unset foamPV foamPV() { - . $WM_PROJECT_DIR/etc/apps/paraview3/bashrc ParaView_VERSION=$1 + . $WM_PROJECT_DIR/etc/config/paraview.sh ParaView_VERSION=$1 echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" } diff --git a/etc/bashrc b/etc/bashrc index d2539c5b50..3aaff82598 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -206,8 +206,8 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.sh # Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/bashrc` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile apps/ensight/bashrc` +_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh` +_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh` # Clean environment paths again. Only remove duplicates diff --git a/etc/apps/ensight/cshrc b/etc/config/ensight.csh similarity index 98% rename from etc/apps/ensight/cshrc rename to etc/config/ensight.csh index 73a00884fc..b1ce4ba112 100644 --- a/etc/apps/ensight/cshrc +++ b/etc/config/ensight.csh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# ensight/cshrc +# config/ensight.csh # # Description # Setup file for Ensight diff --git a/etc/apps/ensight/bashrc b/etc/config/ensight.sh similarity index 98% rename from etc/apps/ensight/bashrc rename to etc/config/ensight.sh index 0e6b981bc8..16ac2bd839 100644 --- a/etc/apps/ensight/bashrc +++ b/etc/config/ensight.sh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# ensight/bashrc +# config/ensight.sh # # Description # Setup file for Ensight diff --git a/etc/config/compiler.csh-EXAMPLE b/etc/config/example/compiler.csh similarity index 94% rename from etc/config/compiler.csh-EXAMPLE rename to etc/config/example/compiler.csh index 6d54edbd47..6905daf8bd 100644 --- a/etc/config/compiler.csh-EXAMPLE +++ b/etc/config/example/compiler.csh @@ -22,10 +22,10 @@ # along with OpenFOAM. If not, see . # # File -# config/compiler.csh +# config/example/compiler.csh # # Description -# Fine tuning of ThirdParty compiler settings for OpenFOAM +# Example of fine tuning ThirdParty compiler settings for OpenFOAM # Sourced from OpenFOAM-/etc/settings.csh # #------------------------------------------------------------------------------ diff --git a/etc/config/compiler.sh-EXAMPLE b/etc/config/example/compiler.sh similarity index 94% rename from etc/config/compiler.sh-EXAMPLE rename to etc/config/example/compiler.sh index bc6aada36e..7dffdcc10c 100644 --- a/etc/config/compiler.sh-EXAMPLE +++ b/etc/config/example/compiler.sh @@ -22,10 +22,10 @@ # along with OpenFOAM. If not, see . # # File -# config/compiler.sh +# config/example/compiler.sh # # Description -# Fine tuning of ThirdParty compiler settings for OpenFOAM +# Example of fine tuning ThirdParty compiler settings for OpenFOAM # Sourced from OpenFOAM-/etc/settings.sh # #------------------------------------------------------------------------------ diff --git a/etc/config/openmpi.csh-EXAMPLE b/etc/config/example/openmpi.csh similarity index 93% rename from etc/config/openmpi.csh-EXAMPLE rename to etc/config/example/openmpi.csh index 94be702e9d..da07872d31 100644 --- a/etc/config/openmpi.csh-EXAMPLE +++ b/etc/config/example/openmpi.csh @@ -22,10 +22,10 @@ # along with OpenFOAM. If not, see . # # File -# config/openmpi.csh +# config/example/openmpi.csh # # Description -# Fine tuning of openmpi settings for OpenFOAM +# Example of fine tuning openmpi settings for OpenFOAM # Sourced from OpenFOAM-/etc/settings.csh # #------------------------------------------------------------------------------ diff --git a/etc/config/openmpi.sh-EXAMPLE b/etc/config/example/openmpi.sh similarity index 93% rename from etc/config/openmpi.sh-EXAMPLE rename to etc/config/example/openmpi.sh index b7c5035b04..7c0ed18543 100644 --- a/etc/config/openmpi.sh-EXAMPLE +++ b/etc/config/example/openmpi.sh @@ -22,10 +22,10 @@ # along with OpenFOAM. If not, see . # # File -# config/openmpi.sh +# config/example/openmpi.sh # # Description -# Fine tuning of openmpi settings for OpenFOAM +# Example of fine tuning openmpi settings for OpenFOAM # Sourced from OpenFOAM-/etc/settings.sh # #------------------------------------------------------------------------------ diff --git a/etc/apps/paraview3/cshrc-EXAMPLE b/etc/config/example/paraview.csh similarity index 86% rename from etc/apps/paraview3/cshrc-EXAMPLE rename to etc/config/example/paraview.csh index 475dbffce0..8509e924e3 100644 --- a/etc/apps/paraview3/cshrc-EXAMPLE +++ b/etc/config/example/paraview.csh @@ -22,10 +22,10 @@ # along with OpenFOAM. If not, see . # # File -# paraview3/cshrc-EXAMPLE +# config/example/paraview.csh # # Description -# Example of chaining to the standard paraview3/cshrc with a +# Example of chaining to the standard config/paraview.csh with a # different ParaView_VERSION # # Note @@ -35,10 +35,10 @@ #------------------------------------------------------------------------------ # -# Use other (shipped) cshrc with a different ParaView_VERSION +# Use other (shipped) paraview.csh with a different ParaView_VERSION # -set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o apps/paraview3/cshrc` +set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o config/paraview.csh` if ( $status == 0 ) source $foamFile ParaView_VERSION=3.9.0 unset foamFile diff --git a/etc/apps/paraview3/bashrc-EXAMPLE b/etc/config/example/paraview.sh similarity index 86% rename from etc/apps/paraview3/bashrc-EXAMPLE rename to etc/config/example/paraview.sh index 8db47a9ec7..09b300f137 100644 --- a/etc/apps/paraview3/bashrc-EXAMPLE +++ b/etc/config/example/paraview.sh @@ -22,10 +22,10 @@ # along with OpenFOAM. If not, see . # # File -# paraview3/bashrc-EXAMPLE +# config/example/paraview.sh # # Description -# Example of chaining to the standard paraview3/bashrc with a +# Example of chaining to the standard config/paraview.sh with a # different ParaView_VERSION # # Note @@ -35,10 +35,10 @@ #------------------------------------------------------------------------------ # -# Use other (shipped) bashrc with a different ParaView_VERSION +# Use other (shipped) paraview.sh with a different ParaView_VERSION # -foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o apps/paraview3/bashrc 2>/dev/null) +foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config/paraview.sh 2>/dev/null) [ $? -eq 0 ] && . $foamFile ParaView_VERSION=3.9.0 unset foamFile diff --git a/etc/apps/paraview3/cshrc b/etc/config/paraview.csh similarity index 99% rename from etc/apps/paraview3/cshrc rename to etc/config/paraview.csh index 867353e843..c9adc6f198 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/config/paraview.csh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# paraview3/cshrc +# config/paraview.csh # # Description # Setup file for paraview-3.x diff --git a/etc/apps/paraview3/bashrc b/etc/config/paraview.sh similarity index 99% rename from etc/apps/paraview3/bashrc rename to etc/config/paraview.sh index 1dd5386829..1c38b3dd3f 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/config/paraview.sh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# paraview3/bashrc +# config/paraview.sh # # Description # Setup file for paraview-3.x @@ -113,7 +113,6 @@ else unset PV_PLUGIN_PATH fi - unset _foamParaviewEval unset cleaned cmake paraviewInstDir paraviewPython diff --git a/etc/apps/scotch/bashrc b/etc/config/scotch.sh similarity index 98% rename from etc/apps/scotch/bashrc rename to etc/config/scotch.sh index 0fb6952110..f32f62292c 100644 --- a/etc/apps/scotch/bashrc +++ b/etc/config/scotch.sh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# scotch/bashrc +# config/scotch.sh # # Description # Setup file for scotch include/libraries. @@ -36,5 +36,4 @@ export SCOTCH_VERSION=scotch_5.1.11 export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$SCOTCH_VERSION - # ----------------------------------------------------------------------------- diff --git a/etc/cshrc b/etc/cshrc index c2c1b12a9b..330fd66aa9 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -199,8 +199,8 @@ _foamSource $WM_PROJECT_DIR/etc/aliases.csh # Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile apps/paraview3/cshrc` -_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile apps/ensight/cshrc` +_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.csh` +_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.csh` # Clean environment paths again. Only remove duplicates diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake index cded295a7e..b620b27791 100755 --- a/src/parallel/decompose/Allwmake +++ b/src/parallel/decompose/Allwmake @@ -3,13 +3,13 @@ cd ${0%/*} || exit 1 # run from this directory makeType=${1:-libso} # get SCOTCH_VERSION, SCOTCH_ARCH_PATH -if settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc` +if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/scotch.sh` then . $settings echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH" else echo - echo "Error: no apps/scotch/bashrc settings" + echo "Error: no config/scotch.sh settings" echo fi From 3202ef296cd0118163d0b8c846210b34cf7d24f9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 3 May 2011 15:06:48 +0200 Subject: [PATCH 02/79] CONF: consolidate more files into OpenFOAM etc/config --- .gitignore | 2 + etc/bashrc | 4 +- etc/config/README | 51 +++++++++++++++++++ etc/{ => config}/aliases.csh | 4 +- etc/{ => config}/aliases.sh | 4 +- etc/config/ensight.csh | 2 +- etc/config/ensight.sh | 2 +- .../example/prefs.csh} | 2 +- .../example/prefs.sh} | 2 +- etc/{ => config}/unset.csh | 2 +- etc/{ => config}/unset.sh | 2 +- etc/cshrc | 4 +- 12 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 etc/config/README rename etc/{ => config}/aliases.csh (96%) rename etc/{ => config}/aliases.sh (97%) rename etc/{prefs.csh-EXAMPLE => config/example/prefs.csh} (98%) rename etc/{prefs.sh-EXAMPLE => config/example/prefs.sh} (98%) rename etc/{ => config}/unset.csh (99%) rename etc/{ => config}/unset.sh (99%) diff --git a/.gitignore b/.gitignore index 1b8ce3cde3..67ac189fcc 100644 --- a/.gitignore +++ b/.gitignore @@ -60,6 +60,8 @@ doc/[Dd]oxygen/man # untracked configuration files /etc/prefs.csh /etc/prefs.sh +/etc/config/prefs.csh +/etc/config/prefs.sh # source packages - anywhere *.tar.bz2 diff --git a/etc/bashrc b/etc/bashrc index 3aaff82598..62c9854d95 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -177,7 +177,7 @@ _foamEval() _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` # Evaluate command-line parameters and record settings for later -# these can be used to set/unset values, or specify prefs files +# these can be used to set/unset values, or specify alternative pref files export FOAM_SETTINGS="$@" _foamEval $@ @@ -201,7 +201,7 @@ export PATH LD_LIBRARY_PATH MANPATH # Source project setup files # ~~~~~~~~~~~~~~~~~~~~~~~~~~ _foamSource $WM_PROJECT_DIR/etc/settings.sh -_foamSource $WM_PROJECT_DIR/etc/aliases.sh +_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh # Source user setup files for optional packages diff --git a/etc/config/README b/etc/config/README new file mode 100644 index 0000000000..8c22b46016 --- /dev/null +++ b/etc/config/README @@ -0,0 +1,51 @@ +The main OpenFOAM settings are located in the parent etc/ directory + +* bashrc, cshrc + entry point for sourcing + +* settings.csh, settings.sh + core settings + +* prefs.csh, prefs.sh + these files are untracked and can be used for some site-defined + settings + + +The etc/config/ directory contains various configuration files in +sh/csh variants: + +* aliases.csh, aliases.sh + aliases for interactive shells + +* unset.csh, unset.sh + sourced to clear as many OpenFOAM environment settings as possible + + +* ensight.csh, ensight.sh + application settings for EnSight + +* paraview.csh, paraview.sh + application settings for ParaView + +* scotch.sh + application settings for compiling against scotch + +--- + +The config/example directory contains various example configuration files +in sh/csh variants + +* compiler.csh, compiler.sh + an example of fine tuning ThirdParty compiler settings for OpenFOAM + +* openmpi.csh, openmpi.sh + an example of fine tuning openmpi settings for OpenFOAM + +* paraview.csh, paraview.sh + an example of chaining to the standard config/paraview.sh with a + different ParaView_VERSION + +* prefs.csh, prefs.sh + an example of supplying alternative site-defined settings + +--- diff --git a/etc/aliases.csh b/etc/config/aliases.csh similarity index 96% rename from etc/aliases.csh rename to etc/config/aliases.csh index 5c5b344497..6573c91973 100644 --- a/etc/aliases.csh +++ b/etc/config/aliases.csh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/aliases.csh +# etc/config/aliases.csh # # Description # Aliases for working with OpenFOAM @@ -39,7 +39,7 @@ alias wmSP 'wmSET WM_PRECISION_OPTION=SP' alias wmDP 'wmSET WM_PRECISION_OPTION=DP' # clear env -alias wmUNSET='source $WM_PROJECT_DIR/etc/unset.csh' +alias wmUNSET='source $WM_PROJECT_DIR/etc/config/unset.csh' # Toggle wmakeScheduler on/off # - also need to set WM_HOSTS diff --git a/etc/aliases.sh b/etc/config/aliases.sh similarity index 97% rename from etc/aliases.sh rename to etc/config/aliases.sh index df0fda7389..188159745c 100644 --- a/etc/aliases.sh +++ b/etc/config/aliases.sh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/aliases.sh +# etc/config/aliases.sh # # Description # Aliases for working with OpenFOAM @@ -39,7 +39,7 @@ alias wmSP='wmSET WM_PRECISION_OPTION=SP' alias wmDP='wmSET WM_PRECISION_OPTION=DP' # clear env -alias wmUNSET='. $WM_PROJECT_DIR/etc/unset.sh' +alias wmUNSET='. $WM_PROJECT_DIR/etc/config/unset.sh' # Toggle wmakeScheduler on/off # - also need to set WM_HOSTS diff --git a/etc/config/ensight.csh b/etc/config/ensight.csh index b1ce4ba112..484fa0fc02 100644 --- a/etc/config/ensight.csh +++ b/etc/config/ensight.csh @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------- # License diff --git a/etc/config/ensight.sh b/etc/config/ensight.sh index 16ac2bd839..597c51c010 100644 --- a/etc/config/ensight.sh +++ b/etc/config/ensight.sh @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/etc/prefs.csh-EXAMPLE b/etc/config/example/prefs.csh similarity index 98% rename from etc/prefs.csh-EXAMPLE rename to etc/config/example/prefs.csh index 56091f798e..83f7a7b7b4 100644 --- a/etc/prefs.csh-EXAMPLE +++ b/etc/config/example/prefs.csh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/prefs.csh +# config/example/prefs.csh # # Description # Preset variables for the OpenFOAM configuration - C-Shell shell syntax. diff --git a/etc/prefs.sh-EXAMPLE b/etc/config/example/prefs.sh similarity index 98% rename from etc/prefs.sh-EXAMPLE rename to etc/config/example/prefs.sh index f3e771d030..d2251ce63f 100644 --- a/etc/prefs.sh-EXAMPLE +++ b/etc/config/example/prefs.sh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/prefs.sh +# config/example/prefs.sh # # Description # Preset variables for the OpenFOAM configuration - POSIX shell syntax. diff --git a/etc/unset.csh b/etc/config/unset.csh similarity index 99% rename from etc/unset.csh rename to etc/config/unset.csh index 48a1637912..d9a3d69787 100644 --- a/etc/unset.csh +++ b/etc/config/unset.csh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/unset.csh +# etc/config/unset.csh # # Description # Clear as many OpenFOAM environment settings as possible diff --git a/etc/unset.sh b/etc/config/unset.sh similarity index 99% rename from etc/unset.sh rename to etc/config/unset.sh index 23e182aa53..66ee2e35b5 100644 --- a/etc/unset.sh +++ b/etc/config/unset.sh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/unset.sh +# etc/config/unset.sh # # Description # Clear as many OpenFOAM environment settings as possible diff --git a/etc/cshrc b/etc/cshrc index 330fd66aa9..c87986832a 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -138,7 +138,7 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh` # Evaluate command-line parameters and record settings for later -# these can be used to set/unset values, or specify prefs files +# these can be used to set/unset values, or specify alternative pref files setenv FOAM_SETTINGS "${*}" while ( $#argv > 0 ) switch ($argv[1]) @@ -195,7 +195,7 @@ if ( $status == 0 ) setenv MANPATH $cleaned # Source project setup files # ~~~~~~~~~~~~~~~~~~~~~~~~~~ _foamSource $WM_PROJECT_DIR/etc/settings.csh -_foamSource $WM_PROJECT_DIR/etc/aliases.csh +_foamSource $WM_PROJECT_DIR/etc/config/aliases.csh # Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From e8e5d2f5a86533b88cf46affe4f2486e63b541b4 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 19 May 2011 13:35:41 +0200 Subject: [PATCH 03/79] CONF: move settings.{csh,sh} into OpenFOAM etc/config - leave bashrc/cshrc and prefs.{csh,sh} in etc/ for visibility --- etc/bashrc | 2 +- etc/config/README | 6 +++--- etc/config/example/compiler.csh | 2 +- etc/config/example/compiler.sh | 2 +- etc/config/example/openmpi.csh | 2 +- etc/config/example/openmpi.sh | 2 +- etc/{ => config}/settings.csh | 10 +++++----- etc/{ => config}/settings.sh | 10 +++++----- etc/cshrc | 2 +- 9 files changed, 19 insertions(+), 19 deletions(-) rename etc/{ => config}/settings.csh (98%) rename etc/{ => config}/settings.sh (97%) diff --git a/etc/bashrc b/etc/bashrc index 62c9854d95..6cd4d8a8cf 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -200,7 +200,7 @@ export PATH LD_LIBRARY_PATH MANPATH # Source project setup files # ~~~~~~~~~~~~~~~~~~~~~~~~~~ -_foamSource $WM_PROJECT_DIR/etc/settings.sh +_foamSource $WM_PROJECT_DIR/etc/config/settings.sh _foamSource $WM_PROJECT_DIR/etc/config/aliases.sh diff --git a/etc/config/README b/etc/config/README index 8c22b46016..2ad58dda54 100644 --- a/etc/config/README +++ b/etc/config/README @@ -3,9 +3,6 @@ The main OpenFOAM settings are located in the parent etc/ directory * bashrc, cshrc entry point for sourcing -* settings.csh, settings.sh - core settings - * prefs.csh, prefs.sh these files are untracked and can be used for some site-defined settings @@ -14,6 +11,9 @@ The main OpenFOAM settings are located in the parent etc/ directory The etc/config/ directory contains various configuration files in sh/csh variants: +* settings.csh, settings.sh + core settings + * aliases.csh, aliases.sh aliases for interactive shells diff --git a/etc/config/example/compiler.csh b/etc/config/example/compiler.csh index 6905daf8bd..a317a703c5 100644 --- a/etc/config/example/compiler.csh +++ b/etc/config/example/compiler.csh @@ -26,7 +26,7 @@ # # Description # Example of fine tuning ThirdParty compiler settings for OpenFOAM -# Sourced from OpenFOAM-/etc/settings.csh +# Sourced from OpenFOAM-/etc/config/settings.csh # #------------------------------------------------------------------------------ diff --git a/etc/config/example/compiler.sh b/etc/config/example/compiler.sh index 7dffdcc10c..3f13b1d9ea 100644 --- a/etc/config/example/compiler.sh +++ b/etc/config/example/compiler.sh @@ -26,7 +26,7 @@ # # Description # Example of fine tuning ThirdParty compiler settings for OpenFOAM -# Sourced from OpenFOAM-/etc/settings.sh +# Sourced from OpenFOAM-/etc/config/settings.sh # #------------------------------------------------------------------------------ diff --git a/etc/config/example/openmpi.csh b/etc/config/example/openmpi.csh index da07872d31..6b46e7494c 100644 --- a/etc/config/example/openmpi.csh +++ b/etc/config/example/openmpi.csh @@ -26,7 +26,7 @@ # # Description # Example of fine tuning openmpi settings for OpenFOAM -# Sourced from OpenFOAM-/etc/settings.csh +# Sourced from OpenFOAM-/etc/config/settings.csh # #------------------------------------------------------------------------------ diff --git a/etc/config/example/openmpi.sh b/etc/config/example/openmpi.sh index 7c0ed18543..1573aadf52 100644 --- a/etc/config/example/openmpi.sh +++ b/etc/config/example/openmpi.sh @@ -26,7 +26,7 @@ # # Description # Example of fine tuning openmpi settings for OpenFOAM -# Sourced from OpenFOAM-/etc/settings.sh +# Sourced from OpenFOAM-/etc/config/settings.sh # #------------------------------------------------------------------------------ diff --git a/etc/settings.csh b/etc/config/settings.csh similarity index 98% rename from etc/settings.csh rename to etc/config/settings.csh index b3daf1e288..986a35a1b6 100644 --- a/etc/settings.csh +++ b/etc/config/settings.csh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/settings.csh +# etc/config/settings.csh # # Description # Startup file for OpenFOAM @@ -193,7 +193,7 @@ unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ( ! $?foamCompiler ) then set foamCompiler=system - echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:" echo " foamCompiler not set, using '$foamCompiler'" endif @@ -241,7 +241,7 @@ case ThirdParty: breaksw default: echo - echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:" echo " Unknown OpenFOAM compiler type '$WM_COMPILER'" echo " Please check your settings" echo @@ -262,7 +262,7 @@ case ThirdParty: # Check that the compiler directory can be found if ( ! -d "$gccDir" ) then echo - echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:" echo " Cannot find $gccDir installation." echo " Please install this compiler version or if you wish to use the system compiler," echo " change the 'foamCompiler' setting to 'system'" @@ -302,7 +302,7 @@ case ThirdParty: # Check that the compiler directory can be found if ( ! -d "$clangDir" ) then echo - echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:" echo " Cannot find $clangDir installation." echo " Please install this compiler version or if you wish to use the system compiler," echo " change the 'foamCompiler' setting to 'system'" diff --git a/etc/settings.sh b/etc/config/settings.sh similarity index 97% rename from etc/settings.sh rename to etc/config/settings.sh index 954868dad1..086ab174c9 100644 --- a/etc/settings.sh +++ b/etc/config/settings.sh @@ -22,7 +22,7 @@ # along with OpenFOAM. If not, see . # # File -# etc/settings.sh +# etc/config/settings.sh # # Description # Startup file for OpenFOAM @@ -215,7 +215,7 @@ unset MPFR_ARCH_PATH GMP_ARCH_PATH if [ -z "$foamCompiler" ] then foamCompiler=system - echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" 1>&2 + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" 1>&2 echo " foamCompiler not set, using '$foamCompiler'" 1>&2 fi @@ -258,7 +258,7 @@ OpenFOAM | ThirdParty) ;; *) echo - echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" echo " Unknown OpenFOAM compiler type '$WM_COMPILER'" echo " Please check your settings" echo @@ -278,7 +278,7 @@ OpenFOAM | ThirdParty) # Check that the compiler directory can be found [ -d "$gccDir" ] || { echo - echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" echo " Cannot find $gccDir installation." echo " Please install this compiler version or if you wish to use the system compiler," echo " change the 'foamCompiler' setting to 'system'" @@ -322,7 +322,7 @@ OpenFOAM | ThirdParty) # Check that the compiler directory can be found [ -d "$clangDir" ] || { echo - echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" + echo "Warning in $WM_PROJECT_DIR/etc/config/settings.sh:" echo " Cannot find $clangDir installation." echo " Please install this compiler version or if you wish to use the system compiler," echo " change the 'foamCompiler' setting to 'system'" diff --git a/etc/cshrc b/etc/cshrc index c87986832a..8e2597e901 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -194,7 +194,7 @@ if ( $status == 0 ) setenv MANPATH $cleaned # Source project setup files # ~~~~~~~~~~~~~~~~~~~~~~~~~~ -_foamSource $WM_PROJECT_DIR/etc/settings.csh +_foamSource $WM_PROJECT_DIR/etc/config/settings.csh _foamSource $WM_PROJECT_DIR/etc/config/aliases.csh # Source user setup files for optional packages From 020d5f9b2d342a02302c2d67246a162324549896 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 19 May 2011 17:32:57 +0200 Subject: [PATCH 04/79] EHN: preserve WM_PROJECT_SITE in bashrc, cshrc - otherwise there is actually no means of placing a site-site prefs.sh in the $WM_PROJECT_SITE/ directory --- etc/bashrc | 7 ++++++- etc/cshrc | 10 ++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 6cd4d8a8cf..edebe538fc 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -120,7 +120,12 @@ export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION # Location of site-specific templates etc # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # unset is equivalent to $WM_PROJECT_INST_DIR/site -unset WM_PROJECT_SITE +if [ -d "$WM_PROJECT_SITE" ] +then + export WM_PROJECT_SITE +else + unset WM_PROJECT_SITE +fi # Location of user files # ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/etc/cshrc b/etc/cshrc index 8e2597e901..658f93da69 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -107,9 +107,6 @@ if ( $?WM_PROJECT_INST_DIR ) then set foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs" endif endif -if ( $?WM_PROJECT_SITE ) then - set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs" -endif # Location of installation @@ -124,7 +121,12 @@ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION # Location of site-specific templates etc # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # unset is equivalent to $WM_PROJECT_INST_DIR/site -unsetenv WM_PROJECT_SITE +if ( $?WM_PROJECT_SITE ) then + set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs" + if ( ! -d "$WM_PROJECT_SITE" ) unsetenv WM_PROJECT_SITE +else + unsetenv WM_PROJECT_SITE +endif # Location of user files # ~~~~~~~~~~~~~~~~~~~~~~ From 7e86354f4f6c36a100a2e9d1abd59c253e432ca8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 May 2011 11:55:59 +0100 Subject: [PATCH 05/79] STYLE: writeRegisteredObject: remove unused switch --- .../writeRegisteredObject.C | 47 ++++++++----------- .../writeRegisteredObject.H | 4 -- 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C index ab24cecb1a..0ec6bf7534 100644 --- a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C +++ b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.C @@ -44,7 +44,6 @@ Foam::writeRegisteredObject::writeRegisteredObject : name_(name), obr_(obr), - active_(true), objectNames_() { read(dict); @@ -61,10 +60,7 @@ Foam::writeRegisteredObject::~writeRegisteredObject() void Foam::writeRegisteredObject::read(const dictionary& dict) { - if (active_) - { - dict.lookup("objectNames") >> objectNames_; - } + dict.lookup("objectNames") >> objectNames_; } @@ -82,32 +78,29 @@ void Foam::writeRegisteredObject::end() void Foam::writeRegisteredObject::write() { - if (active_) + forAll(objectNames_, i) { - forAll(objectNames_, i) + if (obr_.foundObject(objectNames_[i])) { - if (obr_.foundObject(objectNames_[i])) - { - regIOobject& obj = - const_cast - ( - obr_.lookupObject(objectNames_[i]) - ); - // Switch off automatic writing to prevent double write - obj.writeOpt() = IOobject::NO_WRITE; - obj.write(); - } - else - { - WarningIn + regIOobject& obj = + const_cast ( - "Foam::writeRegisteredObject::read(const dictionary&)" - ) << "Object " << objectNames_[i] << " not found in " - << "database. Available objects:" << nl << obr_.sortedToc() - << endl; - } - + obr_.lookupObject(objectNames_[i]) + ); + // Switch off automatic writing to prevent double write + obj.writeOpt() = IOobject::NO_WRITE; + obj.write(); } + else + { + WarningIn + ( + "Foam::writeRegisteredObject::read(const dictionary&)" + ) << "Object " << objectNames_[i] << " not found in " + << "database. Available objects:" << nl << obr_.sortedToc() + << endl; + } + } } diff --git a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H index 9a65acea9d..ecd96e5390 100644 --- a/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H +++ b/src/postProcessing/functionObjects/IO/writeRegisteredObject/writeRegisteredObject.H @@ -65,10 +65,6 @@ protected: const objectRegistry& obr_; - //- On/off switch - bool active_; - - // Read from dictionary //- Names of objects to control From d29798265c96075ae373a736d239f2cabf886889 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 May 2011 11:58:26 +0100 Subject: [PATCH 06/79] ENH: partialWrite: new functionObject for partial dumps --- .../functionObjects/IO/Make/files | 3 + .../functionObjects/IO/controlDict | 88 ++++++++++ .../IO/partialWrite/IOpartialWrite.H | 49 ++++++ .../IO/partialWrite/partialWrite.C | 142 ++++++++++++++++ .../IO/partialWrite/partialWrite.H | 156 ++++++++++++++++++ .../partialWrite/partialWriteFunctionObject.C | 46 ++++++ .../partialWrite/partialWriteFunctionObject.H | 54 ++++++ 7 files changed, 538 insertions(+) create mode 100644 src/postProcessing/functionObjects/IO/controlDict create mode 100644 src/postProcessing/functionObjects/IO/partialWrite/IOpartialWrite.H create mode 100644 src/postProcessing/functionObjects/IO/partialWrite/partialWrite.C create mode 100644 src/postProcessing/functionObjects/IO/partialWrite/partialWrite.H create mode 100644 src/postProcessing/functionObjects/IO/partialWrite/partialWriteFunctionObject.C create mode 100644 src/postProcessing/functionObjects/IO/partialWrite/partialWriteFunctionObject.H diff --git a/src/postProcessing/functionObjects/IO/Make/files b/src/postProcessing/functionObjects/IO/Make/files index a3517e560f..a00b7575f1 100644 --- a/src/postProcessing/functionObjects/IO/Make/files +++ b/src/postProcessing/functionObjects/IO/Make/files @@ -1,3 +1,6 @@ +partialWrite/partialWrite.C +partialWrite/partialWriteFunctionObject.C + writeRegisteredObject/writeRegisteredObject.C writeRegisteredObject/writeRegisteredObjectFunctionObject.C diff --git a/src/postProcessing/functionObjects/IO/controlDict b/src/postProcessing/functionObjects/IO/controlDict new file mode 100644 index 0000000000..4daa3a1c15 --- /dev/null +++ b/src/postProcessing/functionObjects/IO/controlDict @@ -0,0 +1,88 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.7.1 | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application icoFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 0.005; + +writeControl timeStep; + +writeInterval 20; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +functions +{ + partialWrite + { + // Write some registered objects more often than others. + // Above writeControl determines most frequent dump. + + type partialWrite; + + // Where to load it from + functionObjectLibs ("libIOFunctionObjects.so"); + + // Execute upon outputTime + outputControl outputTime; + + // Objects to write every outputTime + objectNames (p); + // Write as normal every writeInterval'th outputTime. + writeInterval 3; + } + + dumpObjects + { + // Forcibly write registered objects. E.g. fields that have been + // created with NO_READ. + + type writeRegisteredObject; + + // Where to load it from + functionObjectLibs ("libIOFunctionObjects.so"); + + // Execute upon outputTime + outputControl outputTime; + + // Objects to write + objectNames (); + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/IO/partialWrite/IOpartialWrite.H b/src/postProcessing/functionObjects/IO/partialWrite/IOpartialWrite.H new file mode 100644 index 0000000000..961f2b6d55 --- /dev/null +++ b/src/postProcessing/functionObjects/IO/partialWrite/IOpartialWrite.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Typedef + Foam::IOpartialWrite + +Description + Instance of the generic IOOutputFilter for partialWrite. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOpartialWrite_H +#define IOpartialWrite_H + +#include "partialWrite.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOpartialWrite; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.C b/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.C new file mode 100644 index 0000000000..327c7b804a --- /dev/null +++ b/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.C @@ -0,0 +1,142 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "partialWrite.H" +#include "dictionary.H" +#include "Time.H" +#include "IOobjectList.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(partialWrite, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::partialWrite::partialWrite +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr) +{ + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::partialWrite::~partialWrite() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::partialWrite::read(const dictionary& dict) +{ + dict.lookup("objectNames") >> objectNames_; + dict.lookup("writeInterval") >> writeInterval_; + writeInstance_ = 0; + + Info<< type() << " " << name() << ":" << nl + << " dumping every outputTime :"; + forAllConstIter(HashSet, objectNames_, iter) + { + Info<< ' ' << iter.key(); + } + Info<< nl + << " dumping all other fields every " + << writeInterval_ << "th outputTime" << nl + << endl; + + if (writeInterval_ < 1) + { + FatalIOErrorIn("partialWrite::read(const dictionary&)", dict) + << "Illegal value for writeInterval " << writeInterval_ + << ". It should be >= 1." + << exit(FatalIOError); + } +} + + +void Foam::partialWrite::execute() +{ + //Pout<< "execute at time " << obr_.time().timeName() + // << " index:" << obr_.time().timeIndex() << endl; +} + + +void Foam::partialWrite::end() +{ + //Pout<< "end at time " << obr_.time().timeName() << endl; + // Do nothing - only valid on write +} + + +void Foam::partialWrite::write() +{ + //Pout<< "write at time " << obr_.time().timeName() << endl; + if (obr_.time().outputTime()) + { + // Above check so it can be used both with + // outputControl timeStep; + // outputInterval 1; + // or with + // outputControl outputTime; + + writeInstance_++; + + if (writeInstance_ == writeInterval_) + { + // Normal dump + writeInstance_ = 0; + } + else + { + // Delete all but marked objects + IOobjectList objects(obr_, obr_.time().timeName()); + + forAllConstIter(HashPtrTable, objects, iter) + { + if (!objectNames_.found(iter()->name())) + { + const fileName f = obr_.time().timePath()/iter()->name(); + //Pout<< " rm " << f << endl; + rm(f); + } + } + } + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.H b/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.H new file mode 100644 index 0000000000..b51b9d1741 --- /dev/null +++ b/src/postProcessing/functionObjects/IO/partialWrite/partialWrite.H @@ -0,0 +1,156 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::partialWrite + +Description + Allows some fields/registered objects to be written more often than others. + + Works in the opposite way: deletes at intermediate times all + but selected fields. + +SourceFiles + partialWrite.C + IOpartialWrite.H + +\*---------------------------------------------------------------------------*/ + +#ifndef partialWrite_H +#define partialWrite_H + +#include "pointFieldFwd.H" +#include "HashSet.H" +#include "DynamicList.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; + +/*---------------------------------------------------------------------------*\ + Class partialWrite Declaration +\*---------------------------------------------------------------------------*/ + +class partialWrite +{ +protected: + + // Private data + + //- Name of this set of partialWrite + word name_; + + const objectRegistry& obr_; + + + // Read from dictionary + + //- Names of objects to dump always + HashSet objectNames_; + + //- Write interval for restart dump + label writeInterval_; + + + //- Current dump instance. If reaches writeInterval do a full write. + label writeInstance_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + partialWrite(const partialWrite&); + + //- Disallow default bitwise assignment + void operator=(const partialWrite&); + + +public: + + //- Runtime type information + TypeName("partialWrite"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + partialWrite + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~partialWrite(); + + + // Member Functions + + //- Return name of the partialWrite + virtual const word& name() const + { + return name_; + } + + //- Read the partialWrite data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Write the partialWrite + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const pointField&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/IO/partialWrite/partialWriteFunctionObject.C b/src/postProcessing/functionObjects/IO/partialWrite/partialWriteFunctionObject.C new file mode 100644 index 0000000000..5c98c82580 --- /dev/null +++ b/src/postProcessing/functionObjects/IO/partialWrite/partialWriteFunctionObject.C @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "partialWriteFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug + ( + partialWriteFunctionObject, + 0 + ); + + addToRunTimeSelectionTable + ( + functionObject, + partialWriteFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/IO/partialWrite/partialWriteFunctionObject.H b/src/postProcessing/functionObjects/IO/partialWrite/partialWriteFunctionObject.H new file mode 100644 index 0000000000..315a5c2282 --- /dev/null +++ b/src/postProcessing/functionObjects/IO/partialWrite/partialWriteFunctionObject.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Typedef + Foam::partialWriteFunctionObject + +Description + FunctionObject wrapper around partialWrite to allow them to be + created via the functions list within controlDict. + +SourceFiles + partialWriteFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef partialWriteFunctionObject_H +#define partialWriteFunctionObject_H + +#include "partialWrite.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject + partialWriteFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 38d068c4765652ebf02a0c1a02618f03bf18098c Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 May 2011 17:00:30 +0100 Subject: [PATCH 07/79] ENH: createShellMesh: guarantee 0'th vertex ordered --- .../extrudeToRegionMesh/createShellMesh.C | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/createShellMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/createShellMesh.C index e57db9f9b3..c2bce48a7a 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/createShellMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/createShellMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -453,6 +453,7 @@ void Foam::createShellMesh::setRefinement label region0 = pointRegions_[eFaces[0]][fp0]; label region1 = pointRegions_[eFaces[0]][fp1]; + // Pick up points with correct normal if (layerI == 0) { newF[0] = f[fp0]; @@ -468,6 +469,22 @@ void Foam::createShellMesh::setRefinement newF[3] = addedPoints[nLayers*region0+layerI]; } + // Optionally rotate so e[0] is always 0th vertex. Note that + // this normally is automatically done by coupled face ordering + // but with NOORDERING we have to do it ourselves. + if (f[fp0] != e[0]) + { + // rotate one back to get newF[1] (originating from e[0]) + // into newF[0] + label v0 = newF[0]; + for (label i = 0; i < newF.size()-1; i++) + { + newF[i] = newF[newF.fcIndex(i)]; + } + newF.last() = v0; + } + + label minCellI = addedCells[nLayers*eFaces[0]+layerI]; label maxCellI; label patchI; @@ -569,6 +586,21 @@ void Foam::createShellMesh::setRefinement newF[3] = addedPoints[nLayers*region0+layerI]; } + + // Optionally rotate so e[0] is always 0th vertex. Note that + // this normally is automatically done by coupled face + // ordering but with NOORDERING we have to do it ourselves. + if (f[fp0] != e[0]) + { + // rotate one back to get newF[1] (originating + // from e[0]) into newF[0]. + label v0 = newF[0]; + for (label i = 0; i < newF.size()-1; i++) + { + newF[i] = newF[newF.fcIndex(i)]; + } + newF.last() = v0; + } ////if (ePatches.size() == 0) //{ // Pout<< "Adding from MULTI face:" From 39d597f3fdb9d7c0b0b68208add5af0478934120 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 May 2011 17:02:33 +0100 Subject: [PATCH 08/79] ENH: globalIndexAndTransform: added debug printing --- .../globalIndexAndTransform.C | 38 ++++++++++++++++++- .../globalIndexAndTransform.H | 4 ++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C index 7032e74a74..b73020d735 100644 --- a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C @@ -24,11 +24,12 @@ License \*---------------------------------------------------------------------------*/ #include "globalIndexAndTransform.H" -#include "coupledPolyPatch.H" #include "cyclicPolyPatch.H" // * * * * * * * * * * * * Private Static Data Members * * * * * * * * * * * // +defineTypeNameAndDebug(Foam::globalIndexAndTransform, 0); + const Foam::label Foam::globalIndexAndTransform::base_ = 32; @@ -478,6 +479,41 @@ Foam::globalIndexAndTransform::globalIndexAndTransform determineTransformPermutations(); determinePatchTransformSign(); + + if (debug && transforms_.size() > 1) + { + Info<< "Determined global transforms :" << endl; + Info<< "\t\ttranslation\trotation" << endl; + forAll(transforms_, i) + { + Info<< '\t' << i << '\t'; + if (transforms_[i].hasR()) + { + Info<< transforms_[i].t() << '\t' << transforms_[i].R(); + } + else + { + Info<< transforms_[i].t() << '\t' << "---"; + } + Info<< endl; + } + Info<< endl; + + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + + Info<< "\tpatch\ttransform\tsign" << endl; + forAll(patchTransformSign_, patchI) + { + if (patchTransformSign_[patchI].first() != -1) + { + Info<< '\t' << patches[patchI].name() + << '\t' << patchTransformSign_[patchI].first() + << '\t' << patchTransformSign_[patchI].second() + << endl; + } + } + Info<< endl; + } } diff --git a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.H b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.H index d9919309fe..0e3cc3f455 100644 --- a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.H +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.H @@ -164,6 +164,10 @@ public: friend class globalPoints; + // Declare name of the class and its debug switch + ClassName("globalIndexAndTransform"); + + // Constructors //- Construct from components From ccd2321a9093ff0b216c825c7960bd332e8e8dc8 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 20 May 2011 18:17:02 +0100 Subject: [PATCH 09/79] BUG: Corrected parallel behaviour of cloud FacePostProcessing model --- .../FacePostProcessing/FacePostProcessing.C | 43 +++++++++---------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C index b3cdad013e..024f439666 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C @@ -66,10 +66,9 @@ void Foam::FacePostProcessing::write() const label procI = Pstream::myProcNo(); scalarListList allProcMass(Pstream::nProcs()); - allProcMass[procI].setSize(massTotal_.size()); allProcMass[procI] = massTotal_; Pstream::gatherList(allProcMass); - scalarList allMass + scalarField allMass ( ListListOps::combine ( @@ -78,10 +77,9 @@ void Foam::FacePostProcessing::write() ); scalarListList allProcMassFlux(Pstream::nProcs()); - allProcMassFlux[procI].setSize(massFlux_.size()); allProcMassFlux[procI] = massFlux_; Pstream::gatherList(allProcMassFlux); - scalarList allMassFlux + scalarField allMassFlux ( ListListOps::combine ( @@ -109,16 +107,8 @@ void Foam::FacePostProcessing::write() pointField uniquePoints(mesh.points(), uniqueMeshPointLabels); List allProcPoints(Pstream::nProcs()); - allProcPoints[procI].setSize(uniquePoints.size()); allProcPoints[procI] = uniquePoints; Pstream::gatherList(allProcPoints); - pointField allPoints - ( - ListListOps::combine - ( - allProcPoints, accessOp() - ) - ); faceList faces(fZone_().localFaces()); forAll(faces, i) @@ -126,20 +116,27 @@ void Foam::FacePostProcessing::write() inplaceRenumber(pointToGlobal, faces[i]); } List allProcFaces(Pstream::nProcs()); - allProcFaces[procI].setSize(faces.size()); allProcFaces[procI] = faces; Pstream::gatherList(allProcFaces); - faceList allFaces - ( - ListListOps::combine - ( - allProcFaces, accessOp() - ) - ); - if (Pstream::master()) { + pointField allPoints + ( + ListListOps::combine + ( + allProcPoints, accessOp() + ) + ); + + faceList allFaces + ( + ListListOps::combine + ( + allProcFaces, accessOp() + ) + ); + fileName outputDir = mesh.time().path(); if (Pstream::parRun()) @@ -165,7 +162,7 @@ void Foam::FacePostProcessing::write() allPoints, allFaces, "massTotal", - massTotal_, + allMass, false ); writer->write @@ -175,7 +172,7 @@ void Foam::FacePostProcessing::write() allPoints, allFaces, "massFlux", - massFlux_, + allMassFlux, false ); } From 8c7edbc07818dc70eafa2f6c647e761dffd7d6d9 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 23 May 2011 11:42:42 +0100 Subject: [PATCH 10/79] ENH: Initial commit of NN spray code --- src/lagrangian/spray/Make/files | 7 + src/lagrangian/spray/Make/options | 25 + .../clouds/Templates/SprayCloud/SprayCloud.C | 449 ++++++++++++++++ .../clouds/Templates/SprayCloud/SprayCloud.H | 205 ++++++++ .../clouds/Templates/SprayCloud/SprayCloudI.H | 60 +++ .../baseClasses/sprayCloud/sprayCloud.C | 48 ++ .../baseClasses/sprayCloud/sprayCloud.H | 84 +++ .../derived/BasicSprayCloud/BasicSprayCloud.H | 60 +++ .../Templates/SprayParcel/SprayParcel.C | 490 ++++++++++++++++++ .../Templates/SprayParcel/SprayParcel.H | 416 +++++++++++++++ .../Templates/SprayParcel/SprayParcelI.H | 313 +++++++++++ .../Templates/SprayParcel/SprayParcelIO.C | 289 +++++++++++ .../BasicSprayParcel/BasicSprayParcel.C | 120 +++++ .../BasicSprayParcel/BasicSprayParcel.H | 147 ++++++ .../BasicSprayParcel/defineBasicSprayParcel.C | 37 ++ .../makeBasicSprayParcelSubmodels.C | 73 +++ .../parcels/include/createSprayParcelTypes.H | 71 +++ .../makeSprayParcelAtomizationModels.H | 90 ++++ .../include/makeSprayParcelBreakupModels.H | 128 +++++ .../include/makeSprayParcelCollisionModels.H | 90 ++++ .../makeSprayParcelCompositionModels.H | 74 +++ .../include/makeSprayParcelDispersionModels.H | 98 ++++ .../include/makeSprayParcelDragModels.H | 82 +++ .../makeSprayParcelHeatTransferModels.H | 82 +++ .../include/makeSprayParcelInjectionModels.H | 149 ++++++ .../makeSprayParcelPatchInteractionModels.H | 92 ++++ .../makeSprayParcelPhaseChangeModels.H | 84 +++ .../makeSprayParcelPostProcessingModels.H | 84 +++ .../AtomizationModel/AtomizationModel.C | 100 ++++ .../AtomizationModel/AtomizationModel.H | 199 +++++++ .../AtomizationModel/NewAtomizationModel.C | 65 +++ .../BlobsSheetAtomization.C | 101 ++++ .../BlobsSheetAtomization.H | 131 +++++ .../LISAAtomization/LISAAtomization.C | 287 ++++++++++ .../LISAAtomization/LISAAtomization.H | 148 ++++++ .../LISAAtomization/LISASMDCalcMethod1.H | 33 ++ .../LISAAtomization/LISASMDCalcMethod2.H | 71 +++ .../NoAtomization/NoAtomization.C | 84 +++ .../NoAtomization/NoAtomization.H | 110 ++++ .../BreakupModel/BreakupModel/BreakupModel.C | 111 ++++ .../BreakupModel/BreakupModel/BreakupModel.H | 239 +++++++++ .../BreakupModel/NewBreakupModel.C | 65 +++ .../submodels/Spray/BreakupModel/ETAB/ETAB.C | 205 ++++++++ .../submodels/Spray/BreakupModel/ETAB/ETAB.H | 149 ++++++ .../Spray/BreakupModel/NoBreakup/NoBreakup.C | 83 +++ .../Spray/BreakupModel/NoBreakup/NoBreakup.H | 113 ++++ .../BreakupModel/PilchErdman/PilchErdman.C | 147 ++++++ .../BreakupModel/PilchErdman/PilchErdman.H | 129 +++++ .../BreakupModel/ReitzDiwakar/ReitzDiwakar.C | 145 ++++++ .../BreakupModel/ReitzDiwakar/ReitzDiwakar.H | 141 +++++ .../Spray/BreakupModel/ReitzKHRT/ReitzKHRT.C | 239 +++++++++ .../Spray/BreakupModel/ReitzKHRT/ReitzKHRT.H | 130 +++++ .../submodels/Spray/BreakupModel/SHF/SHF.C | 259 +++++++++ .../submodels/Spray/BreakupModel/SHF/SHF.H | 171 ++++++ .../submodels/Spray/BreakupModel/TAB/TAB.C | 245 +++++++++ .../submodels/Spray/BreakupModel/TAB/TAB.H | 152 ++++++ .../BreakupModel/TAB/TABSMDCalcMethod1.H | 15 + .../BreakupModel/TAB/TABSMDCalcMethod2.H | 54 ++ .../CollisionModel/CollisionModel.C | 89 ++++ .../CollisionModel/CollisionModel.H | 201 +++++++ .../CollisionModel/NewCollisionModel.C | 65 +++ .../CollisionModel/NoCollision/NoCollision.C | 88 ++++ .../CollisionModel/NoCollision/NoCollision.H | 119 +++++ .../ORourkeCollision/ORourkeCollision.C | 294 +++++++++++ .../ORourkeCollision/ORourkeCollision.H | 155 ++++++ .../TrajectoryCollision/TrajectoryCollision.C | 342 ++++++++++++ .../TrajectoryCollision/TrajectoryCollision.H | 155 ++++++ 67 files changed, 9576 insertions(+) create mode 100644 src/lagrangian/spray/Make/files create mode 100644 src/lagrangian/spray/Make/options create mode 100644 src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C create mode 100644 src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H create mode 100644 src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H create mode 100644 src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.C create mode 100644 src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.H create mode 100644 src/lagrangian/spray/clouds/derived/BasicSprayCloud/BasicSprayCloud.H create mode 100644 src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C create mode 100644 src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H create mode 100644 src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H create mode 100644 src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelIO.C create mode 100644 src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.C create mode 100644 src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.H create mode 100644 src/lagrangian/spray/parcels/derived/BasicSprayParcel/defineBasicSprayParcel.C create mode 100644 src/lagrangian/spray/parcels/derived/BasicSprayParcel/makeBasicSprayParcelSubmodels.C create mode 100644 src/lagrangian/spray/parcels/include/createSprayParcelTypes.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelAtomizationModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelBreakupModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelCollisionModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelCompositionModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelDispersionModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelDragModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelHeatTransferModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelPatchInteractionModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelPhaseChangeModels.H create mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelPostProcessingModels.H create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.C create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.H create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/NewAtomizationModel.C create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.C create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.H create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.C create mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/NewBreakupModel.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.C create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod1.H create mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod2.H create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.C create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.H create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/NewCollisionModel.C create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.C create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.H create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.C create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.H create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.C create mode 100644 src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.H diff --git a/src/lagrangian/spray/Make/files b/src/lagrangian/spray/Make/files new file mode 100644 index 0000000000..50487e18a8 --- /dev/null +++ b/src/lagrangian/spray/Make/files @@ -0,0 +1,7 @@ +clouds/baseClasses/sprayCloud/sprayCloud.C + +SPRAYPARCEL=parcels/derived/BasicSprayParcel +$(SPRAYPARCEL)/defineBasicSprayParcel.C +$(SPRAYPARCEL)/makeBasicSprayParcelSubmodels.C + +LIB = $(FOAM_LIBBIN)/libspray diff --git a/src/lagrangian/spray/Make/options b/src/lagrangian/spray/Make/options new file mode 100644 index 0000000000..9740405e80 --- /dev/null +++ b/src/lagrangian/spray/Make/options @@ -0,0 +1,25 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude + +LIB_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -llagrangian \ + -llagrangianIntermediate diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C new file mode 100644 index 0000000000..760b52a0e3 --- /dev/null +++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C @@ -0,0 +1,449 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "SprayCloud.H" +#include "AtomizationModel.H" +#include "BreakupModel.H" +#include "CollisionModel.H" +#include "PtrList.H" + +template +void Foam::SprayCloud::preEvolve() +{ + ReactingCloud::preEvolve(); +} + + +template +void Foam::SprayCloud::evolveCloud() +{ + const volScalarField& T = this->carrierThermo().T(); + const volScalarField cp = this->carrierThermo().Cp(); + const volScalarField& p = this->carrierThermo().p(); + + autoPtr > rhoInterp = interpolation::New + ( + this->interpolationSchemes(), + this->rho() + ); + + autoPtr > UInterp = interpolation::New + ( + this->interpolationSchemes(), + this->U() + ); + + autoPtr > muInterp = interpolation::New + ( + this->interpolationSchemes(), + this->mu() + ); + + autoPtr > TInterp = interpolation::New + ( + this->interpolationSchemes(), + T + ); + + autoPtr > cpInterp = interpolation::New + ( + this->interpolationSchemes(), + cp + ); + + autoPtr > pInterp = interpolation::New + ( + this->interpolationSchemes(), + p + ); + + typename ParcelType::trackData td + ( + *this, + constProps_, + rhoInterp(), + UInterp(), + muInterp(), + TInterp(), + cpInterp(), + pInterp(), + this->g().value() + ); + + if (this->coupled()) + { + resetSourceTerms(); + } + + if (collision().active()) + { + + label i = 0; + scalar dt = this->db().time().deltaTValue(); + forAllIter(typename Cloud, *this, iter) + { + + label j = 0; + forAllIter(typename Cloud, *this, jter) + { + if (j > i) + { + ParcelType& p = iter(); + scalar Vi = this->mesh().V()[p.cell()]; + scalarField X1(this->composition().liquids().X(p.Y())); + scalar sigma1 = this->composition().liquids().sigma(p.pc(), p.T(), X1); + scalar mp = p.mass()*p.nParticle(); + + ParcelType& q = jter(); + scalar Vj = this->mesh().V()[q.cell()]; + scalarField X2(this->composition().liquids().X(q.Y())); + scalar sigma2 = this->composition().liquids().sigma(q.pc(), q.T(), X2); + scalar mq = q.mass()*q.nParticle(); + + bool updateProperties = collision().update + ( + dt, + this->rndGen(), + p.position(), + mp, + p.d(), + p.nParticle(), + p.U(), + p.rho(), + p.T(), + p.Y(), + sigma1, + p.cell(), + Vi, + q.position(), + mq, + q.d(), + q.nParticle(), + q.U(), + q.rho(), + q.T(), + q.Y(), + sigma2, + q.cell(), + Vj + ); + + // for coalescence we need to update the density and + // the diameter cause of the temp/conc/mass-change + if (updateProperties) + { + if (mp > VSMALL) + { + scalarField Xp(this->composition().liquids().X(p.Y())); + p.rho() = this->composition().liquids().rho(p.pc(), p.T(), Xp); + p.cp() = this->composition().liquids().cp(p.pc(), p.T(), Xp); + scalar rhs = 6.0*mp/(p.nParticle()*p.rho()*mathematicalConstant::pi); + p.d() = pow(rhs, 1.0/3.0); + } + + if (mq > VSMALL) + { + scalarField Xq(this->composition().liquids().X(q.Y())); + q.rho() = this->composition().liquids().rho(q.pc(), q.T(), Xq); + q.cp() = this->composition().liquids().cp(q.pc(), q.T(), Xq); + scalar rhs = 6.0*mq/(q.nParticle()*q.rho()*mathematicalConstant::pi); + q.d() = pow(rhs, 1.0/3.0); + } + + } + } + j++; + } + + i++; + } + + // remove coalesced particles (diameter set to 0) + forAllIter(typename Cloud, *this, iter) + { + ParcelType& p = iter(); + if (p.mass() < VSMALL) + { + deleteParticle(p); + } + } + } + + Cloud::move(td); + this->injection().inject(td); +} + + +template +void Foam::SprayCloud::postEvolve() +{ + ReactingCloud::postEvolve(); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::SprayCloud::SprayCloud +( + const word& cloudName, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + basicThermo& thermo, + bool readFields +) +: + ReactingCloud(cloudName, rho, U, g, thermo, false), + sprayCloud(), + averageParcelMass_(this->injection().averageParcelMass()), + constProps_(this->particleProperties()), + atomizationModel_ + ( + AtomizationModel >::New + ( + this->particleProperties(), + *this + ) + ), + breakupModel_ + ( + BreakupModel >::New + ( + this->particleProperties(), + *this + ) + ), + collisionModel_ + ( + CollisionModel >::New + ( + this->particleProperties(), + *this + ) + ) +{ + if (readFields) + { + ParcelType::readFields(*this); + } + + Info << " Average parcel mass: " << averageParcelMass_ << endl; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::SprayCloud::~SprayCloud() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::SprayCloud::checkParcelProperties +( + ParcelType& parcel, + const scalar lagrangianDt, + const bool fullyDescribed +) +{ + ReactingCloud::checkParcelProperties + ( + parcel, + lagrangianDt, + fullyDescribed + ); + + const scalarField& Y(parcel.Y()); + scalarField X(this->composition().liquids().X(Y)); + + // override rho and cp from constantProperties + parcel.cp() = this->composition().liquids().cp(parcel.pc(), parcel.T(), X); + parcel.rho() = this->composition().liquids().rho(parcel.pc(), parcel.T(), X); + + // store the injection position and initial drop size + parcel.position0() = parcel.position(); + parcel.d0() = parcel.d(); + + parcel.y() = breakup().y0(); + parcel.yDot() = breakup().yDot0(); +} + +template +Foam::scalar Foam::SprayCloud::D(const label i, const label j) const +{ + scalar si = 0.0; + scalar sj = 0.0; + forAllConstIter(typename Cloud, *this, iter) + { + const ParcelType& p = iter(); + si += p.nParticle()*pow(p.d(), i); + sj += p.nParticle()*pow(p.d(), j); + } + + reduce(si, sumOp()); + reduce(sj, sumOp()); + sj = max(sj, VSMALL); + + return si/sj; +} + + +template +Foam::scalar Foam::SprayCloud::liquidPenetration(const scalar& prc) const +{ + + scalar distance = 0.0; + scalar mTot = 0.0; + + label Np = this->size(); + + // arrays containing the parcels mass and + // distance from injector in ascending order + scalarField mass(Np); + scalarField dist(Np); + + if (Np > 0) + { + label n = 0; + + // first arrange the parcels in ascending order + // the first parcel is closest to its injection position + // and the last one is most far away. + forAllConstIter(typename Cloud, *this, iter) + { + const ParcelType& p = iter(); + scalar mi = p.nParticle()*p.mass(); + scalar di = mag(p.position() - p.position0()); + mTot += mi; + + // insert at the last place + mass[n] = mi; + dist[n] = di; + + label i = 0; + bool found = false; + + // insert the parcel in the correct place + // and move the others + while ( ( i < n ) && ( !found ) ) + { + if (di < dist[i]) + { + found = true; + for(label j=n; j>i; j--) + { + mass[j] = mass[j-1]; + dist[j] = dist[j-1]; + } + mass[i] = mi; + dist[i] = di; + } + i++; + } + n++; + } + } + + reduce(mTot, sumOp()); + + if (Np > 0) + { + + scalar mLimit = prc*mTot; + scalar mOff = (1.0 - prc)*mTot; + + if (Np > 1) + { + + // 'prc' is large enough that the parcel most far + // away will be used, no need to loop... + if (mLimit > mTot - mass[Np-1]) + { + distance = dist[Np-1]; + } + else + { + scalar mOffSum = 0.0; + label i = Np; + + while ((mOffSum < mOff) && (i>0)) + { + i--; + mOffSum += mass[i]; + } + distance = dist[i+1] + (dist[i]-dist[i+1])*(mOffSum - mOff)/mass[i+1] ; + } + } + else + { + distance = dist[0]; + } + } + + reduce(distance, maxOp()); + + return distance; +} + +template +void Foam::SprayCloud::resetSourceTerms() +{ + ReactingCloud::resetSourceTerms(); +} + + +template +void Foam::SprayCloud::evolve() +{ + if (this->active()) + { + preEvolve(); + + evolveCloud(); + + postEvolve(); + + info(); + Info<< endl; + } +} + + +template +void Foam::SprayCloud::info() const +{ + ReactingCloud::info(); + scalar d32 = 1.0e+6*D(3,2); + scalar pen = liquidPenetration(0.95); + + Info << " D32 (mu) = " << d32 << endl; + Info << " Liquid penetration 95% mass (m) = " << pen << endl; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H new file mode 100644 index 0000000000..bb27f1d8e2 --- /dev/null +++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H @@ -0,0 +1,205 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::SprayCloud + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef SprayCloud_H +#define SprayCloud_H + +#include "ReactingCloud.H" +#include "sprayCloud.H" +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +template +class AtomizationModel; + +template +class BreakupModel; + +template +class CollisionModel; + +/*---------------------------------------------------------------------------*\ + Class SprayCloud Declaration +\*---------------------------------------------------------------------------*/ + + +template +class SprayCloud +: + public ReactingCloud, + public sprayCloud +{ +private: + + //- Average parcel mass + scalar averageParcelMass_; + +public: + + //- Type of thermodynamics the cloud was instantiated for + typedef typename ParcelType::thermoType thermoType; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + SprayCloud(const SprayCloud&); + + //- Disallow default bitwise assignment + void operator=(const SprayCloud&); + + +protected: + + //- Parcel constant properties + typename ParcelType::constantProperties constProps_; + + // Reference to the cloud sub-models + autoPtr > > atomizationModel_; + + autoPtr > > breakupModel_; + + autoPtr > > collisionModel_; + + // Cloud evolution functions + + //- Pre-evolve + void preEvolve(); + + //- Evolve the cloud + void evolveCloud(); + + //- Post-evolve + void postEvolve(); + + +public: + + // Constructors + + //- Construct given carrier gas fields + SprayCloud + ( + const word& cloudName, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + basicThermo& thermo, + bool readFields = true + ); + + + //- Destructor + virtual ~SprayCloud(); + + + //- Type of parcel the cloud was instantiated for + typedef ParcelType parcelType; + + // Member Functions + + // Access + + //- Return the constant properties + inline const typename ParcelType::constantProperties& + constProps() const; + + // Check + + //- Print cloud information + void info() const; + + // Cloud evolution functions + + //- Check parcel properties + void checkParcelProperties + ( + ParcelType& parcel, + const scalar lagrangianDt, + const bool fullyDescribed + ); + + //- Reset the spray source terms + void resetSourceTerms(); + + //- Evolve the spray (inject, move) + void evolve(); + + //- Return const-access to the atomization model + inline const AtomizationModel >& + atomization() const; + + //- Return const-access to the breakup model + inline const BreakupModel >& + breakup() const; + + //- Return const-access to the breakup model + inline const CollisionModel >& + collision() const; + + //- Return const-access to the average parcel mass + inline const scalar& averageParcelMass() const; + + //- Calculate the diameter Dij + scalar D(const label i, const label j) const; + + //- Calculate the liquid penetration for prc % of the mass + scalar liquidPenetration(const scalar& prc) const; + +}; + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "SprayCloudI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "SprayCloud.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H new file mode 100644 index 0000000000..08f97293f0 --- /dev/null +++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline const typename ParcelType::constantProperties& +Foam::SprayCloud::constProps() const +{ + return constProps_; +} + +template +inline const Foam::AtomizationModel >& Foam::SprayCloud::atomization() const +{ + return atomizationModel_; +} + +template +inline const Foam::BreakupModel >& +Foam::SprayCloud::breakup() const +{ + return breakupModel_; +} + +template +inline const Foam::CollisionModel >& +Foam::SprayCloud::collision() const +{ + return collisionModel_; +} + +template +inline const Foam::scalar& Foam::SprayCloud::averageParcelMass() const +{ + return averageParcelMass_; +} + diff --git a/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.C b/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.C new file mode 100644 index 0000000000..522afeffc1 --- /dev/null +++ b/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.C @@ -0,0 +1,48 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "sprayCloud.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(sprayCloud, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::sprayCloud::sprayCloud() +{} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // + +Foam::sprayCloud::~sprayCloud() +{} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.H b/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.H new file mode 100644 index 0000000000..afbae6cd90 --- /dev/null +++ b/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.H @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::sprayCloud + +Description + Virtual abstract base class for templated SprayCloud + +SourceFiles + sprayCloud.C + +\*---------------------------------------------------------------------------*/ + +#ifndef sprayCloud_H +#define sprayCloud_H + +#include "typeInfo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class sprayCloud Declaration +\*---------------------------------------------------------------------------*/ + +class sprayCloud +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + sprayCloud(const sprayCloud&); + + //- Disallow default bitwise assignment + void operator=(const sprayCloud&); + + +public: + + //- Runtime type information + TypeName("sprayCloud"); + + // Constructors + + //- Null constructor + sprayCloud(); + + + //- Destructor + virtual ~sprayCloud(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/clouds/derived/BasicSprayCloud/BasicSprayCloud.H b/src/lagrangian/spray/clouds/derived/BasicSprayCloud/BasicSprayCloud.H new file mode 100644 index 0000000000..2c57a37aa1 --- /dev/null +++ b/src/lagrangian/spray/clouds/derived/BasicSprayCloud/BasicSprayCloud.H @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::BasicSprayCloud + +Description + +\*---------------------------------------------------------------------------*/ + +#ifndef BasicSprayCloud_H +#define BasicSprayCloud_H + +#include "BasicSprayParcel.H" +#include "SprayCloud.H" +#include "SprayParcel.H" +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + + typedef SprayCloud > + thermoSprayCloud; + + typedef SprayCloud > + constThermoSprayCloud; + + typedef SprayCloud > + icoPoly8ThermoSprayCloud; + +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C new file mode 100644 index 0000000000..4ab5ac3b5e --- /dev/null +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C @@ -0,0 +1,490 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "SprayParcel.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::SprayParcel::SprayParcel +( + const SprayParcel& p +) +: + ReactingParcel(p), + d0_(p.d0_), + position0_(p.position0_), + liquidCore_(p.liquidCore_), + KHindex_(p.KHindex_), + y_(p.y_), + yDot_(p.yDot_), + tc_(p.tc_), + ms_(p.ms_), + injector_(p.injector_), + tMom_(p.tMom_), + user_(p.user_) +{} + + +// * * * * * * * * * * * Member Functions * * * * * * * * * * * * // + +// NN. Dont think all these functions are needed, but I'm adding them in case +// one might have to add anything later + + +template +template +void Foam::SprayParcel::setCellValues +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + ReactingParcel::setCellValues(td, dt, cellI); +} + + +template +template +void Foam::SprayParcel::cellValueSourceCorrection +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + ReactingParcel::cellValueSourceCorrection(td, dt, cellI); +} + + +template +template +void Foam::SprayParcel::correctSurfaceValues +( + TrackData& td, + const label cellI, + const scalar T, + const scalarField& Cs, + scalar& rhos, + scalar& mus, + scalar& Pr, + scalar& kappa +) +{ + ReactingParcel::correctSurfaceValues + ( + td, + cellI, + T, + Cs, + rhos, + mus, + Pr, + kappa + ); +} + +template +template +void Foam::SprayParcel::calc +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + + bool coupled = td.cloud().coupled(); + + // check if parcel belongs to liquid core + if (liquidCore() > 0.5) + { + // liquid core parcels should not interact with the gas + if (td.cloud().coupled()) + { + td.cloud().coupled() = false; + } + } + + // store the parcel properties + const scalarField& Y(this->Y()); + scalarField X(td.cloud().composition().liquids().X(Y)); + + scalar T0 = this->T(); + this->cp() = td.cloud().composition().liquids().cp(this->pc_, T0, X); + scalar rho0 = td.cloud().composition().liquids().rho(this->pc_, T0, X); + this->rho() = rho0; + + ReactingParcel::calc(td, dt, cellI); + + if (td.keepParticle) + { + + // update drop cp, diameter and density because of change in temperature/composition + scalar T1 = this->T(); + const scalarField& Y1(this->Y()); + scalarField X1(td.cloud().composition().liquids().X(Y1)); + + this->cp() = td.cloud().composition().liquids().cp(this->pc_, T1, X1); + + scalar rho1 = td.cloud().composition().liquids().rho(this->pc_, T1, X1); + this->rho() = rho1; + scalar d1 = this->d()*pow(rho0/rho1, 1.0/3.0); + this->d() = d1; + + if (liquidCore() > 0.5) + { + calcAtomization(td, dt, cellI); + + // preserve the total mass/volume, by increasing the number of particles in parcels due to breakup + scalar d2 = this->d(); + this->nParticle() *= pow(d1/d2, 3.0); + } + else + { + calcBreakup(td, dt, cellI); + } + } + + // restore coupled + td.cloud().coupled() = coupled; +} + + +template +template +void Foam::SprayParcel::calcAtomization +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + + // cell state info is updated in ReactingParcel calc + const scalarField& Y(this->Y()); + scalarField X(td.cloud().composition().liquids().X(Y)); + + scalar rho = td.cloud().composition().liquids().rho(this->pc_, this->T(), X); + scalar mu = td.cloud().composition().liquids().mu(this->pc_, this->T(), X); + scalar sigma = td.cloud().composition().liquids().sigma(this->pc_, this->T(), X); + + // Average molecular weight of carrier mix - assumes perfect gas + scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; + scalar R = specie::RR/Wc; + scalar Tav = td.cloud().atomization().Taverage(this->T(), this->Tc_); + + // calculate average gas density based on average temperature + scalar rhoAv = this->pc_/(R*Tav); + + scalar soi = td.cloud().injection().timeStart(); + scalar currentTime = this->cloud().db().time().value(); + const vector& pos = this->position(); + const vector& injectionPos = this->position0(); + + // disregard the continous phase when calculating the relative velocity + // (in line with the deactivated coupled assumption) + scalar Urel = mag(this->U()); + + scalar traveledTime = mag(pos - injectionPos)/Urel; + scalar t0 = max(0.0, currentTime - traveledTime - soi); + scalar t1 = min(t0 + dt, td.cloud().injection().timeEnd() - soi); + // this should be the massflow from when the parcel was injected + scalar massflowRate = rho*td.cloud().injection().volumeToInject(t0, t1)/dt; + + scalar chi = 0.0; + if (td.cloud().atomization().calcChi()) + { + chi = this->chi(td, X); + } + + td.cloud().atomization().update + ( + dt, + this->d(), + this->liquidCore(), + this->tc(), + rho, + mu, + sigma, + massflowRate, + rhoAv, + Urel, + pos, + injectionPos, + td.cloud().pAmbient(), + chi, + td.cloud().rndGen() + ); + +} + + +template +template +void Foam::SprayParcel::calcBreakup +( + TrackData& td, + const scalar dt, + const label cellI +) +{ + + if (td.cloud().breakup().solveOscillationEq()) + { + solveTABEq(td, dt); + } + + // cell state info is updated in ReactingParcel calc + const scalarField& Y(this->Y()); + scalarField X(td.cloud().composition().liquids().X(Y)); + + scalar rho = td.cloud().composition().liquids().rho(this->pc_, this->T(), X); + scalar mu = td.cloud().composition().liquids().mu(this->pc_, this->T(), X); + scalar sigma = td.cloud().composition().liquids().sigma(this->pc_, this->T(), X); + + // Average molecular weight of carrier mix - assumes perfect gas + scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; + scalar R = specie::RR/Wc; + scalar Tav = td.cloud().atomization().Taverage(this->T(), this->Tc_); + + // calculate average gas density based on average temperature + scalar rhoAv = this->pc_/(R*Tav); + scalar muAv = this->muc_; + vector Urel = this->U() - this->Uc_; + scalar Urmag = mag(Urel); + scalar As = this->areaS(this->d()); + scalar Re = rhoAv*Urmag*this->d()/muAv; + + scalar utc = td.cloud().drag().utc(Re, this->d(), muAv) + ROOTVSMALL; + scalar tMom = 1.0/(As*utc); + + const vector g = td.cloud().g().value(); + + scalar massChild = 0.0; + scalar dChild = 0.0; + if + ( + td.cloud().breakup().update + ( + dt, + g, + this->d(), + this->tc(), + this->ms(), + this->nParticle(), + this->KHindex(), + this->y(), + this->yDot(), + this->d0(), + rho, + mu, + sigma, + this->U(), + rhoAv, + muAv, + Urel, + Urmag, + tMom, + td.cloud().averageParcelMass(), + dChild, + massChild, + td.cloud().rndGen() + ) + ) + { + + scalar As = this->areaS(dChild); + scalar Re = rhoAv*Urmag*dChild/muAv; + scalar utc = td.cloud().drag().utc(Re, dChild, muAv) + ROOTVSMALL; + this->mass0() -= massChild; + + // add child parcel. most properties will be identical to the parent + ParcelType* child = new ParcelType(td.cloud(), this->position(), cellI); + scalar massDrop = rho*mathematicalConstant::pi*pow(dChild, 3.0)/6.0; + child->mass0() = massChild; + child->d() = dChild; + child->rho() = this->rho(); + child->T() = this->T(); + child->cp() = this->cp(); + child->U() = this->U(); + child->nParticle() = massChild/massDrop; + child->d0() = this->d0(); + child->position0() = this->position0(); + child->liquidCore() = 0.0; + child->KHindex() = 1.0; + child->y() = td.cloud().breakup().y0(); + child->yDot() = td.cloud().breakup().yDot0(); + child->tc() = -GREAT; + child->ms() = 0.0; + child->injector() = this->injector(); + child->tMom() = 1.0/(As*utc); + child->Y() = this->Y(); + child->user() = 0.0; + child->setCellValues(td, dt, cellI); + + td.cloud().addParticle(child); + } +} + + +template +template +Foam::scalar Foam::SprayParcel::chi +( + TrackData& td, + const scalarField& X +) const +{ + + +// modifications to take account of the flash boiling on primary breakUp + + scalar chi = 0.0; + label Nf = td.cloud().composition().liquids().components().size(); + + scalar Td = this->T(); + scalar pAmb = td.cloud().pAmbient(); + + for(label i = 0; i < Nf ; i++) + { + scalar pv = td.cloud().composition().liquids().sigma(this->pc_, this->T(), X); + + if(pv >= 0.999*pAmb) + { + +// The fuel is boiling..... +// Calculation of the boiling temperature + + scalar tBoilingSurface = Td; + + label Niter = 200; + + for(label k=0; k< Niter ; k++) + { + scalar pBoil = td.cloud().composition().liquids().properties()[i].pv(this->pc_, tBoilingSurface); + + if(pBoil > this->pc_) + { + tBoilingSurface = tBoilingSurface - (Td-this->Tc_)/Niter; + } + else + { + break; + } + } + + scalar hl = td.cloud().composition().liquids().properties()[i].hl(pAmb, tBoilingSurface); + scalar iTp = td.cloud().composition().liquids().properties()[i].h(pAmb, Td) - pAmb/td.cloud().composition().liquids().properties()[i].rho(pAmb, Td); + scalar iTb = td.cloud().composition().liquids().properties()[i].h(pAmb, tBoilingSurface) - pAmb/td.cloud().composition().liquids().properties()[i].rho(pAmb, tBoilingSurface); + + chi += X[i]*(iTp-iTb)/hl; + + } + } + + // bound chi + chi = max(chi, 0.0); + chi = min(chi, 1.0); + + return chi; +} + +template +template +void Foam::SprayParcel::solveTABEq +( + TrackData& td, + const scalar& dt +) +{ + const scalar& TABCmu = td.cloud().breakup().TABCmu(); + const scalar& TABWeCrit = td.cloud().breakup().TABWeCrit(); + const scalar& TABComega = td.cloud().breakup().TABComega(); + + + scalar r = 0.5 * this->d_; + scalar r2 = r*r; + scalar r3 = r*r2; + + const scalarField& Y(this->Y()); + scalarField X(td.cloud().composition().liquids().X(Y)); + + scalar rho = td.cloud().composition().liquids().rho(this->pc_, this->T(), X); + scalar mu = td.cloud().composition().liquids().mu(this->pc_, this->T(), X); + scalar sigma = td.cloud().composition().liquids().sigma(this->pc_, this->T(), X); + + // inverse of characteristic viscous damping time + scalar rtd = 0.5*TABCmu*mu/(rho*r2); + + // oscillation frequency (squared) + scalar omega2 = TABComega * sigma /(rho*r3) - rtd*rtd; + + if(omega2 > 0) + { + scalar omega = sqrt(omega2); + scalar rhoc = this->rhoc_; //spray_.rho()[p.cell()]; + scalar We = rhoc*pow(mag(this->Uc_ - this->U()), 2.0)*r/sigma; + + //scalar We = p.We(Ug, rhog, sigma); + scalar Wetmp = We/TABWeCrit; + + scalar y1 = this->y() - Wetmp; + scalar y2 = this->yDot()/omega; + + // update distortion parameters + scalar c = cos(omega*dt); + scalar s = sin(omega*dt); + scalar e = exp(-rtd*dt); + y2 = (this->yDot() + y1*rtd)/omega; + + this->y() = Wetmp + e*(y1*c + y2*s); + if (this->y() < 0) + { + this->y() = 0.0; + this->yDot() = 0.0; + } + else + { + this->yDot() = (Wetmp - this->y())*rtd + e*omega*(y2*c - y1*s); + } + } + else + { + // reset droplet distortion parameters + this->y() = 0; + this->yDot() = 0; + } + +} + +// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // + +#include "SprayParcelIO.C" + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H new file mode 100644 index 0000000000..af26fee515 --- /dev/null +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H @@ -0,0 +1,416 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::SprayParcel + +Description + Derived from ReacingParcel, with added functionality + for atomization and breakup + +\*---------------------------------------------------------------------------*/ + +#ifndef SprayParcel_H +#define SprayParcel_H + +#include "ReactingParcel.H" +#include "SprayCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +template +class SprayParcel; + +template +Ostream& operator<< +( + Ostream&, + const SprayParcel& +); + +/*---------------------------------------------------------------------------*\ + Class SprayParcel Declaration +\*---------------------------------------------------------------------------*/ + +template +class SprayParcel +: + public ReactingParcel +{ +protected: + + // protected properties + + // spray parcel properties + + //- initial droplet diameter + scalar d0_; + + //- injection position + vector position0_; + + //- part of liquid core ( > 0.5-liquid, < 0.5-droplet ) + scalar liquidCore_; + + //- index for KH Breakup + scalar KHindex_; + + //- spherical deviation + scalar y_; + + //- rate of change of spherical deviation + scalar yDot_; + + //- characteristic time (used in atomization and/or breakup model) + scalar tc_; + + //- stripped parcel mass due to breakup + scalar ms_; + + //- injected from injector (needed for ex. for calculating distance from injector) + scalar injector_; + + //- momentum relaxation time (needed for calculating parcel acc.) + scalar tMom_; + + //- passive scalar (extra variable to be defined by user) + scalar user_; + +public: + + //- Class to hold reacting particle constant properties + class constantProperties + : + public ReactingParcel::constantProperties + { + public: + + //- Constructor + constantProperties(const dictionary& parentDict); + }; + + + //- Class used to pass reacting tracking data to the trackToFace function + class trackData + : + public ReactingParcel::trackData + { + + // Private data + + //- Reference to the cloud containing this particle + SprayCloud& cloud_; + + //- Particle constant properties + const constantProperties& constProps_; + + public: + + typedef SprayCloud cloudType; + + + // Constructors + + //- Construct from components + inline trackData + ( + SprayCloud& cloud, + const constantProperties& constProps, + const interpolation& rhoInterp, + const interpolation& UInterp, + const interpolation& muInterp, + const interpolation& TInterp, + const interpolation& CpInterp, + const interpolation& pInterp, + const vector& g + ); + + + // Member functions + + //- Return access to the owner cloud + inline SprayCloud& cloud(); + + //- Return const access to the constant properties + inline const constantProperties& constProps() const; + + }; + + + // Static data members + + //- String representation of properties + static string propHeader; + + //- Runtime type information + TypeName("SprayParcel"); + + + friend class Cloud; + + + // Constructors + + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + inline SprayParcel + ( + SprayCloud& owner, + const vector& position, + const label cellI + ); + + //- Construct from components + inline SprayParcel + ( + SprayCloud& owner, + const vector& position, + const label cellI, + const label typeId, + const scalar nParticle0, + const scalar d0, + const vector& U0, + const scalarField& Y0, + const scalar& dInit, + const scalar& liquidCore, + const scalar& KHindex, + const scalar& y, + const scalar& yDot, + const scalar& tc, + const scalar& ms, + const scalar& injector, + const scalar& tMom, + const scalar& user, + const constantProperties& constProps + ); + + //- Construct from Istream + SprayParcel + ( + const Cloud& c, + Istream& is, + bool readFields = true + ); + + //- Construct as a copy + SprayParcel(const SprayParcel& p); + + //- Construct and return a clone + autoPtr clone() const + { + return autoPtr(new SprayParcel(*this)); + } + + // Member Functions + + // Access + + //- Return const access to initial droplet diameter + inline const scalar& d0() const; + + //- Return const access to initial droplet position + inline const vector& position0() const; + + //- Return const access to liquid core + inline const scalar& liquidCore() const; + + //- Return const access to Kelvin-Helmholtz breakup index + inline const scalar& KHindex() const; + + //- Return const access to spherical deviation + inline const scalar& y() const; + + //- Return const access to rate of change of spherical deviation + inline const scalar& yDot() const; + + //- Return const access to atomization characteristic time + inline const scalar& tc() const; + + //- Return const access to stripped parcel mass + inline const scalar& ms() const; + + //- Return const access to injector id + inline const scalar& injector() const; + + //- Return const access to momentum relaxation time + inline const scalar& tMom() const; + + //- Return const access to passive user scalar + inline const scalar& user() const; + + // Edit + + //- Return access to initial droplet diameter + inline scalar& d0(); + + //- Return access to initial droplet position + inline vector& position0(); + + //- Return access to liquid core + inline scalar& liquidCore(); + + //- Return access to Kelvin-Helmholtz breakup index + inline scalar& KHindex(); + + //- Return access to spherical deviation + inline scalar& y(); + + //- Return access to rate of change of spherical deviation + inline scalar& yDot(); + + //- Return access to atomization characteristic time + inline scalar& tc(); + + //- Return access to stripped parcel mass + inline scalar& ms(); + + //- Return access to injector id + inline scalar& injector(); + + //- Return access to momentum relaxation time + inline scalar& tMom(); + + //- Return access to passive user scalar + inline scalar& user(); + + + // Main calculation loop + + //- Set cell values + template + void setCellValues + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Correct parcel properties according to atomization model + template + void calcAtomization + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Correct parcel properties according to breakup model + template + void calcBreakup + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Correct cell values using latest transfer information + template + void cellValueSourceCorrection + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Correct surface values due to emitted species + template + void correctSurfaceValues + ( + TrackData& td, + const label cellI, + const scalar T, + const scalarField& Cs, + scalar& rhos, + scalar& mus, + scalar& Pr, + scalar& kappa + ); + + //- Update parcel properties over the time interval + template + void calc + ( + TrackData& td, + const scalar dt, + const label cellI + ); + + //- Calculate the chi-factor for flash-boiling for the atomization model + template + scalar chi + ( + TrackData& td, + const scalarField& X + ) const; + + + //- Solve the TAB equation + template + void solveTABEq + ( + TrackData& td, + const scalar& dt + ); + + // I-O + + //- Read + static void readFields(Cloud& c); + + //- Write + static void writeFields(const Cloud& c); + + + // Ostream Operator + + friend Ostream& operator<< + ( + Ostream&, + const SprayParcel& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "SprayParcelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "SprayParcel.C" +#endif + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H new file mode 100644 index 0000000000..f54aac2bb4 --- /dev/null +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H @@ -0,0 +1,313 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +inline Foam::SprayParcel::constantProperties::constantProperties +( + const dictionary& parentDict +) +: + ReactingParcel::constantProperties + ( + parentDict, + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("rhoMin")).value(), + 1000.0, // rho0 bypassed + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("minParticleMass")).value(), + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("T0")).value(), + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("TMin")).value(), + 4000.0, // cp0 bypassed + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("epsilon0")).value(), + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("f0")).value(), + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("Pr")).value(), + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("pMin")).value(), + false, // constant volume + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("Tvap")).value(), + dimensionedScalar((parentDict.subDict("constantProperties")).lookup("Tbp")).value() + ) +{ + +} + + +template +inline Foam::SprayParcel::trackData::trackData +( + SprayCloud& cloud, + const constantProperties& constProps, + const interpolation& rhoInterp, + const interpolation& UInterp, + const interpolation& muInterp, + const interpolation& TInterp, + const interpolation& CpInterp, + const interpolation& pInterp, + const vector& g +) +: + ReactingParcel::trackData + ( + cloud, + constProps, + rhoInterp, + UInterp, + muInterp, + TInterp, + CpInterp, + pInterp, + g + ), + cloud_(cloud), + constProps_(constProps) +{} + + +template +inline Foam::SprayParcel::SprayParcel +( + SprayCloud& owner, + const vector& position, + const label cellI +) +: + ReactingParcel(owner, position, cellI), + d0_(this->d()), + position0_(position), + liquidCore_(owner.atomization().initLiquidCore()), + KHindex_(0.0), + y_(0.0), + yDot_(0.0), + tc_(0.0), + ms_(0.0), + injector_(1.0), + tMom_(GREAT), + user_(0.0) +{} + + +template +inline Foam::SprayParcel::SprayParcel +( + SprayCloud& owner, + const vector& position, + const label cellI, + const label typeId, + const scalar nParticle0, + const scalar d0, + const vector& U0, + const scalarField& Y0, + const scalar& dInit, + const scalar& liquidCore, + const scalar& KHindex, + const scalar& y, + const scalar& yDot, + const scalar& tc, + const scalar& ms, + const scalar& injector, + const scalar& tMom, + const scalar& user, + const constantProperties& constProps +) +: + ReactingParcel + ( + owner, + position, + cellI, + typeId, + nParticle0, + d0, + U0, + Y0, + constProps + ), + d0_(dInit), + position0_(position), + liquidCore_(liquidCore), + KHindex_(KHindex), + y_(y), + yDot_(yDot), + tc_(tc), + ms_(ms), + injector_(injector), + tMom_(tMom), + user_(user) +{} + +// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * // + +template +inline Foam::SprayCloud& +Foam::SprayParcel::trackData::cloud() +{ + return cloud_; +} + + +template +inline const typename Foam::SprayParcel::constantProperties& +Foam::SprayParcel::trackData::constProps() const +{ + return constProps_; +} + + + +// * * * * * * * * * * SprayParcel Member Functions * * * * * * * * * * * * // + +template +inline const Foam::scalar& Foam::SprayParcel::d0() const +{ + return d0_; +} + +template +inline const Foam::vector& Foam::SprayParcel::position0() const +{ + return position0_; +} + +template +inline const Foam::scalar& Foam::SprayParcel::liquidCore() const +{ + return liquidCore_; +} + +template +inline const Foam::scalar& Foam::SprayParcel::KHindex() const +{ + return KHindex_; +} + +template +inline const Foam::scalar& Foam::SprayParcel::y() const +{ + return y_; +} + +template +inline const Foam::scalar& Foam::SprayParcel::yDot() const +{ + return yDot_; +} + + +template +inline const Foam::scalar& Foam::SprayParcel::tc() const +{ + return tc_; +} + +template +inline const Foam::scalar& Foam::SprayParcel::ms() const +{ + return ms_; +} + +template +inline const Foam::scalar& Foam::SprayParcel::injector() const +{ + return injector_; +} + +template +inline const Foam::scalar& Foam::SprayParcel::tMom() const +{ + return tMom_; +} + + +template +inline const Foam::scalar& Foam::SprayParcel::user() const +{ + return user_; +} + +template +inline Foam::scalar& Foam::SprayParcel::d0() +{ + return d0_; +} + +template +inline Foam::vector& Foam::SprayParcel::position0() +{ + return position0_; +} + +template +inline Foam::scalar& Foam::SprayParcel::liquidCore() +{ + return liquidCore_; +} + +template +inline Foam::scalar& Foam::SprayParcel::KHindex() +{ + return KHindex_; +} + +template +inline Foam::scalar& Foam::SprayParcel::y() +{ + return y_; +} + +template +inline Foam::scalar& Foam::SprayParcel::yDot() +{ + return yDot_; +} + +template +inline Foam::scalar& Foam::SprayParcel::tc() +{ + return tc_; +} + +template +inline Foam::scalar& Foam::SprayParcel::ms() +{ + return ms_; +} + +template +inline Foam::scalar& Foam::SprayParcel::injector() +{ + return injector_; +} + +template +inline Foam::scalar& Foam::SprayParcel::tMom() +{ + return tMom_; +} + + +template +inline Foam::scalar& Foam::SprayParcel::user() +{ + return user_; +} diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelIO.C b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelIO.C new file mode 100644 index 0000000000..1122f4fdb3 --- /dev/null +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelIO.C @@ -0,0 +1,289 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "SprayParcel.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template +Foam::string Foam::SprayParcel::propHeader = + ReactingParcel::propHeader + + " d0" + + " position0" + + " liquidCore" + + " KHindex" + + " y" + + " yDot" + + " tc" + + " ms" + + " injector" + + " tMom" + + " user"; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::SprayParcel::SprayParcel +( + const Cloud& cloud, + Istream& is, + bool readFields +) +: + ReactingParcel(cloud, is, readFields), + d0_(0.0), + position0_(vector::zero), + liquidCore_(0.0), + KHindex_(0.0), + y_(0.0), + yDot_(0.0), + tc_(0.0), + ms_(0.0), + injector_(1.0), + tMom_(GREAT), + user_(0.0) +{ + if (readFields) + { + + if (is.format() == IOstream::ASCII) + { + d0_ = readScalar(is); + is >> position0_; + liquidCore_ = readScalar(is); + KHindex_ = readScalar(is); + y_ = readScalar(is); + yDot_ = readScalar(is); + tc_ = readScalar(is); + ms_ = readScalar(is); + injector_ = readScalar(is); + tMom_ = readScalar(is); + user_ = readScalar(is); + } + else + { + is.read + ( + reinterpret_cast(&d0_), + sizeof(d0_) + + sizeof(position0_) + + sizeof(liquidCore_) + + sizeof(KHindex_) + + sizeof(y_) + + sizeof(yDot_) + + sizeof(tc_) + + sizeof(ms_) + + sizeof(injector_) + + sizeof(tMom_) + + sizeof(user_) + ); + } + } + + // Check state of Istream + is.check + ( + "SprayParcel::SprayParcel" + "(" + "const Cloud&, " + "Istream&, " + "bool" + ")" + ); +} + + +template +void Foam::SprayParcel::readFields(Cloud& cIn) +{ + if (!cIn.size()) + { + return; + } + + SprayCloud& c = + dynamic_cast&>(cIn); + + ReactingParcel::readFields(c); + + IOField d0(c.fieldIOobject("d0", IOobject::MUST_READ)); + c.checkFieldIOobject(c, d0); + + IOField position0(c.fieldIOobject("position0", IOobject::MUST_READ)); + c.checkFieldIOobject(c, position0); + + IOField liquidCore(c.fieldIOobject("liquidCore", IOobject::MUST_READ)); + c.checkFieldIOobject(c, liquidCore); + + IOField KHindex(c.fieldIOobject("KHindex", IOobject::MUST_READ)); + c.checkFieldIOobject(c, KHindex); + + IOField y(c.fieldIOobject("y", IOobject::MUST_READ)); + c.checkFieldIOobject(c, y); + + IOField yDot(c.fieldIOobject("yDot", IOobject::MUST_READ)); + c.checkFieldIOobject(c, yDot); + + IOField tc(c.fieldIOobject("tc", IOobject::MUST_READ)); + c.checkFieldIOobject(c, tc); + + IOField ms(c.fieldIOobject("ms", IOobject::MUST_READ)); + c.checkFieldIOobject(c, ms); + + IOField injector(c.fieldIOobject("injector", IOobject::MUST_READ)); + c.checkFieldIOobject(c, injector); + + IOField tMom(c.fieldIOobject("tMom", IOobject::MUST_READ)); + c.checkFieldIOobject(c, tMom); + + IOField user(c.fieldIOobject("user", IOobject::MUST_READ)); + c.checkFieldIOobject(c, user); + + label i = 0; + forAllIter(typename Cloud, c, iter) + { + SprayParcel& p = iter(); + p.d0_ = d0[i]; + p.position0_ = position0[i]; + p.liquidCore_ = liquidCore[i]; + p.KHindex_ = KHindex[i]; + p.y_ = y[i]; + p.yDot_ = yDot[i]; + p.tc_ = tc[i]; + p.ms_ = ms[i]; + p.injector_ = injector[i]; + p.tMom_ = tMom[i]; + p.user_ = user[i]; + i++; + } +} + + +template +void Foam::SprayParcel::writeFields +( + const Cloud& cIn +) +{ + const SprayCloud& c = + dynamic_cast&>(cIn); + + ReactingParcel::writeFields(c); + + label np = c.size(); + + IOField d0(c.fieldIOobject("d0", IOobject::NO_READ), np); + IOField position0(c.fieldIOobject("position0", IOobject::NO_READ), np); + IOField liquidCore(c.fieldIOobject("liquidCore", IOobject::NO_READ), np); + IOField KHindex(c.fieldIOobject("KHindex", IOobject::NO_READ), np); + IOField y(c.fieldIOobject("y", IOobject::NO_READ), np); + IOField yDot(c.fieldIOobject("yDot", IOobject::NO_READ), np); + IOField tc(c.fieldIOobject("tc", IOobject::NO_READ), np); + IOField ms(c.fieldIOobject("ms", IOobject::NO_READ), np); + IOField injector(c.fieldIOobject("injector", IOobject::NO_READ), np); + IOField tMom(c.fieldIOobject("tMom", IOobject::NO_READ), np); + IOField user(c.fieldIOobject("user", IOobject::NO_READ), np); + + label i = 0; + forAllConstIter(typename Cloud, c, iter) + { + const SprayParcel& p = iter(); + d0[i] = p.d0_; + position0[i] = p.position0_; + liquidCore[i] = p.liquidCore_; + KHindex[i] = p.KHindex_; + y[i] = p.y_; + yDot[i] = p.yDot_; + tc[i] = p.tc_; + ms[i] = p.ms_; + injector[i] = p.injector_; + tMom[i] = p.tMom_; + user[i] = p.user_; + i++; + } + + d0.write(); + position0.write(); + liquidCore.write(); + KHindex.write(); + y.write(); + yDot.write(); + tc.write(); + ms.write(); + injector.write(); + tMom.write(); + user.write(); +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const SprayParcel& p +) +{ + if (os.format() == IOstream::ASCII) + { + os << static_cast&>(p) + << token::SPACE << p.d0() + << token::SPACE << p.position0() + << token::SPACE << p.liquidCore() + << token::SPACE << p.KHindex() + << token::SPACE << p.y() + << token::SPACE << p.yDot() + << token::SPACE << p.tc() + << token::SPACE << p.ms() + << token::SPACE << p.injector() + << token::SPACE << p.tMom() + << token::SPACE << p.user(); + } + else + { + os << static_cast&>(p); + os.write + ( + reinterpret_cast(&p.d0_), + sizeof(p.d0()) + sizeof(p.position0()) + sizeof(p.liquidCore()) + sizeof(p.KHindex()) + + sizeof(p.y()) + sizeof(p.yDot()) + sizeof(p.tc()) + sizeof(p.ms()) + + sizeof(p.injector()) + sizeof(p.tMom()) + sizeof(p.user()) + ); + } + + // Check state of Ostream + os.check + ( + "Ostream& operator<<(Ostream&, const SprayParcel&)" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.C b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.C new file mode 100644 index 0000000000..709dcd4521 --- /dev/null +++ b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.C @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "BasicSprayParcel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::BasicSprayParcel::BasicSprayParcel +( + SprayCloud >& owner, + const vector& position, + const label cellI +) +: + SprayParcel >(owner, position, cellI) +{} + +template +Foam::BasicSprayParcel::BasicSprayParcel +( + SprayCloud >& owner, + const vector& position, + const label cellI, + const label typeId, + const scalar nParticle0, + const scalar d0, + const vector& U0, + const scalarField& Y0, + const scalar& dInit, + const scalar& liquidCore, + const scalar& KHindex, + const scalar& y, + const scalar& yDot, + const scalar& tc, + const scalar& ms, + const scalar& injector, + const scalar& tMom, + const scalar& user, + const typename SprayParcel >:: + constantProperties& constProps +) +: + SprayParcel > + ( + owner, + position, + cellI, + typeId, + nParticle0, + d0, + U0, + Y0, + dInit, + liquidCore, + KHindex, + y, + yDot, + tc, + ms, + injector, + tMom, + user, + constProps + ) +{} + +template +Foam::BasicSprayParcel::BasicSprayParcel +( + const Cloud >& cloud, + Istream& is, + bool readFields +) +: + SprayParcel >(cloud, is, readFields) +{} + + +template +Foam::BasicSprayParcel::BasicSprayParcel +( + const BasicSprayParcel& p +) +: + SprayParcel(p) +{} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // + +template +Foam::BasicSprayParcel::~BasicSprayParcel() +{} + + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.H b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.H new file mode 100644 index 0000000000..8738177faf --- /dev/null +++ b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.H @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::BasicSprayParcel + +Description + +SourceFiles + BasicSprayParcelI.H + BasicSprayParcel.C + BasicSprayParcelIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef BasicSprayParcel_H +#define BasicSprayParcel_H + +#include "SprayParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +template +class BasicSprayParcel; + +/*---------------------------------------------------------------------------*\ + Class BasicSprayParcel Declaration +\*---------------------------------------------------------------------------*/ + +template +class BasicSprayParcel +: + public SprayParcel > +{ + +public: + + //- The type of thermodynamics this parcel was instantiated for + typedef ThermoType thermoType; + + //- Run-time type information + TypeName("BasicSprayParcel"); + + // Constructors + + //- Construct from owner, position, and cloud owner + // Other properties initialised as null + BasicSprayParcel + ( + SprayCloud& owner, + const vector& position, + const label cellI + ); + + //- Construct from components + BasicSprayParcel + ( + SprayCloud& owner, + const vector& position, + const label cellI, + const label typeId, + const scalar nParticle0, + const scalar d0, + const vector& U0, + const scalarField& Y0, + const scalar& dInit, + const scalar& liquidCore, + const scalar& KHindex, + const scalar& y, + const scalar& yDot, + const scalar& tc, + const scalar& ms, + const scalar& injector, + const scalar& tMom, + const scalar& user, + const typename SprayParcel:: + constantProperties& constProps + ); + + //- Construct from Istream + BasicSprayParcel + ( + const Cloud& c, + Istream& is, + bool readFields = true + ); + + //- Construct as a copy + BasicSprayParcel(const BasicSprayParcel& p); + + //- Construct and return a clone + autoPtr clone() const + { + return + autoPtr + ( + new BasicSprayParcel(*this) + ); + } + + + //- Destructor + virtual ~BasicSprayParcel(); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "BasicSprayParcel.C" +#endif + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/defineBasicSprayParcel.C b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/defineBasicSprayParcel.C new file mode 100644 index 0000000000..c8c4747db9 --- /dev/null +++ b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/defineBasicSprayParcel.C @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "createSprayParcelTypes.H" +#include "BasicSprayParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + createSprayParcelType(BasicSprayParcel); +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/makeBasicSprayParcelSubmodels.C b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/makeBasicSprayParcelSubmodels.C new file mode 100644 index 0000000000..a37b6a0a89 --- /dev/null +++ b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/makeBasicSprayParcelSubmodels.C @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "BasicSprayParcel.H" + +// Kinematic +#include "makeSprayParcelDispersionModels.H" +#include "makeSprayParcelDragModels.H" +#include "makeSprayParcelInjectionModels.H" +#include "makeSprayParcelPatchInteractionModels.H" +#include "makeSprayParcelPostProcessingModels.H" + +// Thermodynamic +#include "makeSprayParcelHeatTransferModels.H" + +// Reacting +#include "makeSprayParcelCompositionModels.H" +#include "makeSprayParcelPhaseChangeModels.H" + +// Spray +#include "makeSprayParcelAtomizationModels.H" +#include "makeSprayParcelBreakupModels.H" +#include "makeSprayParcelCollisionModels.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + // Kinematic sub-models + makeSprayDispersionModels(BasicSprayParcel); + makeSprayDragModels(BasicSprayParcel); + makeSprayInjectionModels(BasicSprayParcel); + makeSprayPatchInteractionModels(BasicSprayParcel); + makeSprayPostProcessingModels(BasicSprayParcel); + + // Thermo sub-models + makeSprayHeatTransferModels(BasicSprayParcel); + + // Reacting sub-models + makeSprayCompositionModels(BasicSprayParcel); + makeSprayPhaseChangeModels(BasicSprayParcel); + + // Spray sub-models + makeSprayAtomizationModels(BasicSprayParcel); + makeSprayBreakupModels(BasicSprayParcel); + makeSprayCollisionModels(BasicSprayParcel); + +}; + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/createSprayParcelTypes.H b/src/lagrangian/spray/parcels/include/createSprayParcelTypes.H new file mode 100644 index 0000000000..9020d8fc0a --- /dev/null +++ b/src/lagrangian/spray/parcels/include/createSprayParcelTypes.H @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef createSprayParcelTypes_H +#define createSprayParcelTypes_H + +#include "thermoPhysicsTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define createSprayParcelType(ParcelType) \ + \ + createSprayParcelThermoType(ParcelType, gasThermoPhysics); \ + createSprayParcelThermoType(ParcelType, constGasThermoPhysics); \ + createSprayParcelThermoType(ParcelType, icoPoly8ThermoPhysics); + + +#define createSprayParcelThermoType(ParcelType, ThermoType) \ + \ + typedef ParcelType ParcelType##ThermoType; \ + \ + defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \ + defineTemplateTypeNameAndDebug(Particle, 0); \ + defineTemplateTypeNameAndDebug(Cloud, 0); \ + \ + defineParcelTypeNameAndDebug(KinematicParcel, 0); \ + defineTemplateTypeNameAndDebug \ + ( \ + KinematicParcel, \ + 0 \ + ); \ + defineParcelTypeNameAndDebug(ThermoParcel, 0); \ + defineTemplateTypeNameAndDebug(ThermoParcel, 0); \ + defineParcelTypeNameAndDebug(ReactingParcel, 0); \ + defineTemplateTypeNameAndDebug(ReactingParcel, 0);\ + defineParcelTypeNameAndDebug(SprayParcel, 0); \ + defineTemplateTypeNameAndDebug(SprayParcel, 0); \ + \ + defineParcelTypeNameAndDebug(KinematicCloud, 0); \ + defineParcelTypeNameAndDebug(ThermoCloud, 0); \ + defineParcelTypeNameAndDebug(ReactingCloud, 0); \ + defineParcelTypeNameAndDebug(SprayCloud, 0); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelAtomizationModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelAtomizationModels.H new file mode 100644 index 0000000000..382d72fe1d --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelAtomizationModels.H @@ -0,0 +1,90 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelAtomizationModels_H +#define makeSprayParcelAtomizationModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "SprayCloud.H" + +#include "NoAtomization.H" +#include "BlobsSheetAtomization.H" +#include "LISAAtomization.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayAtomizationModels(ParcelType) \ + \ + makeSprayAtomizationModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + makeSprayAtomizationModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + makeSprayAtomizationModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + +#define makeSprayAtomizationModelThermoType(ParcelType, ThermoType) \ + \ + makeAtomizationModel(SprayCloud >); \ + \ + makeAtomizationModelThermoType \ + ( \ + NoAtomization, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeAtomizationModelThermoType \ + ( \ + BlobsSheetAtomization, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeAtomizationModelThermoType \ + ( \ + LISAAtomization, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelBreakupModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelBreakupModels.H new file mode 100644 index 0000000000..69ffa8c294 --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelBreakupModels.H @@ -0,0 +1,128 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelBreakupModels_H +#define makeSprayParcelBreakupModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "SprayCloud.H" + +#include "NoBreakup.H" +#include "ReitzDiwakar.H" +#include "ReitzKHRT.H" +#include "TAB.H" +#include "ETAB.H" +#include "SHF.H" +#include "PilchErdman.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayBreakupModels(ParcelType) \ + \ + makeSprayBreakupModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + \ + makeSprayBreakupModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + \ + makeSprayBreakupModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + +#define makeSprayBreakupModelThermoType(ParcelType, ThermoType) \ + \ + makeBreakupModel(SprayCloud >); \ + \ + makeBreakupModelThermoType \ + ( \ + NoBreakup, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeBreakupModelThermoType \ + ( \ + PilchErdman, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeBreakupModelThermoType \ + ( \ + SHF, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeBreakupModelThermoType \ + ( \ + ETAB, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeBreakupModelThermoType \ + ( \ + TAB, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeBreakupModelThermoType \ + ( \ + ReitzKHRT, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeBreakupModelThermoType \ + ( \ + ReitzDiwakar, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelCollisionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelCollisionModels.H new file mode 100644 index 0000000000..bc9816ca59 --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelCollisionModels.H @@ -0,0 +1,90 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelCollisionModels_H +#define makeSprayParcelCollisionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "SprayCloud.H" + +#include "NoCollision.H" +#include "ORourkeCollision.H" +#include "TrajectoryCollision.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayCollisionModels(ParcelType) \ + \ + makeSprayCollisionModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + makeSprayCollisionModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + makeSprayCollisionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + +#define makeSprayCollisionModelThermoType(ParcelType, ThermoType) \ + \ + makeCollisionModel(SprayCloud >); \ + \ + makeCollisionModelThermoType \ + ( \ + NoCollision, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeCollisionModelThermoType \ + ( \ + ORourkeCollision, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); \ + \ + makeCollisionModelThermoType \ + ( \ + TrajectoryCollision, \ + SprayCloud, \ + ParcelType, \ + ThermoType \ + ); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelCompositionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelCompositionModels.H new file mode 100644 index 0000000000..3ffb8fc3e0 --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelCompositionModels.H @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelCompositionModels_H +#define makeSprayParcelCompositionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "SprayCloud.H" + +#include "SinglePhaseMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayCompositionModels(ParcelType) \ + \ + makeSprayCompositionModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + makeSprayCompositionModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + makeSprayCompositionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + + +#define makeSprayCompositionModelThermoType(ParcelType, ThermoType) \ + \ + makeCompositionModel(ReactingCloud >); \ + \ + makeCompositionModelThermoType \ + ( \ + SinglePhaseMixture, \ + ReactingCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelDispersionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelDispersionModels.H new file mode 100644 index 0000000000..40054d6197 --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelDispersionModels.H @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelDispersionModels_H +#define makeSprayParcelDispersionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "KinematicCloud.H" + +#include "NoDispersion.H" +#include "GradientDispersionRAS.H" +#include "StochasticDispersionRAS.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayDispersionModels(ParcelType) \ + \ + makeSprayDispersionModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + \ + makeSprayDispersionModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + \ + makeSprayDispersionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + + +#define makeSprayDispersionModelThermoType(ParcelType, ThermoType) \ + \ + makeDispersionModel(KinematicCloud >); \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + DispersionRASModel > >, \ + 0 \ + ); \ + \ + makeDispersionModelThermoType \ + ( \ + NoDispersion, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeDispersionModelThermoType \ + ( \ + GradientDispersionRAS, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeDispersionModelThermoType \ + ( \ + StochasticDispersionRAS, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelDragModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelDragModels.H new file mode 100644 index 0000000000..a11c46a21d --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelDragModels.H @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelDragModels_H +#define makeSprayParcelDragModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "KinematicCloud.H" + +#include "NoDrag.H" +#include "SphereDrag.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayDragModels(ParcelType) \ + \ + makeSprayDragModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + makeSprayDragModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + makeSprayDragModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + + +#define makeSprayDragModelThermoType(ParcelType, ThermoType) \ + \ + makeDragModel(KinematicCloud >); \ + \ + makeDragModelThermoType \ + ( \ + NoDrag, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeDragModelThermoType \ + ( \ + SphereDrag, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelHeatTransferModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelHeatTransferModels.H new file mode 100644 index 0000000000..6585d2fbf8 --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelHeatTransferModels.H @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelHeatTransferModels_H +#define makeSprayParcelHeatTransferModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "ThermoCloud.H" + +#include "NoHeatTransfer.H" +#include "RanzMarshall.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayHeatTransferModels(ParcelType) \ + \ + makeSprayHeatTransferModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + makeSprayHeatTransferModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + makeSprayHeatTransferModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + + +#define makeSprayHeatTransferModelThermoType(ParcelType, ThermoType) \ + \ + makeHeatTransferModel(ThermoCloud >); \ + \ + makeHeatTransferModelThermoType \ + ( \ + NoHeatTransfer, \ + ThermoCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeHeatTransferModelThermoType \ + ( \ + RanzMarshall, \ + ThermoCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H new file mode 100644 index 0000000000..07d07ce0a1 --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H @@ -0,0 +1,149 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelInjectionModels_H +#define makeSprayParcelInjectionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "KinematicCloud.H" + +#include "ConeInjection.H" +#include "ConeInjectionMP.H" +#include "FieldActivatedInjection.H" +#include "ManualInjection.H" +#include "NoInjection.H" +#include "PatchInjection.H" +#include "UnitInjection.H" +#include "CommonRailInjection.H" +#include "MultiHoleInjection.H" +//#include "ReactingLookupTableInjection.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayInjectionModels(ParcelType) \ + \ + makeSprayInjectionModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + \ + makeSprayInjectionModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + \ + makeSprayInjectionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + + +#define makeSprayInjectionModelThermoType(ParcelType, ThermoType) \ + \ + makeInjectionModel(KinematicCloud >); \ + \ + makeInjectionModelThermoType \ + ( \ + ConeInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + ConeInjectionMP, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + FieldActivatedInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + ManualInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + NoInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + PatchInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + CommonRailInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + MultiHoleInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makeInjectionModelThermoType \ + ( \ + UnitInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); +/* + makeInjectionModelThermoType \ + ( \ + SprayLookupTableInjection, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); +*/ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelPatchInteractionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelPatchInteractionModels.H new file mode 100644 index 0000000000..fdec7fafa4 --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelPatchInteractionModels.H @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelPatchInteractionModels_H +#define makeSprayParcelPatchInteractionModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "KinematicCloud.H" + +#include "LocalInteraction.H" +#include "Rebound.H" +#include "StandardWallInteraction.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayPatchInteractionModels(ParcelType) \ + \ + makeSprayPatchInteractionModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + \ + makeSprayPatchInteractionModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + \ + makeSprayPatchInteractionModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + + +#define makeSprayPatchInteractionModelThermoType(ParcelType, ThermoType) \ + \ + makePatchInteractionModel(KinematicCloud >); \ + \ + makePatchInteractionModelThermoType \ + ( \ + LocalInteraction, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makePatchInteractionModelThermoType \ + ( \ + Rebound, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makePatchInteractionModelThermoType \ + ( \ + StandardWallInteraction, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelPhaseChangeModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelPhaseChangeModels.H new file mode 100644 index 0000000000..3e207ac88c --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelPhaseChangeModels.H @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelPhaseChangeModels_H +#define makeSprayParcelPhaseChangeModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "SprayCloud.H" + +#include "NoPhaseChange.H" +#include "LiquidEvaporation.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayPhaseChangeModels(ParcelType) \ + \ + makeSprayPhaseChangeModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + \ + makeSprayPhaseChangeModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + \ + makeSprayPhaseChangeModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + + +#define makeSprayPhaseChangeModelThermoType(ParcelType, ThermoType) \ + \ + makePhaseChangeModel(ReactingCloud >); \ + \ + makePhaseChangeModelThermoType \ + ( \ + NoPhaseChange, \ + ReactingCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makePhaseChangeModelThermoType \ + ( \ + LiquidEvaporation, \ + ReactingCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelPostProcessingModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelPostProcessingModels.H new file mode 100644 index 0000000000..6fdf9db6a7 --- /dev/null +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelPostProcessingModels.H @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef makeSprayParcelPostProcessingModels_H +#define makeSprayParcelPostProcessingModels_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "thermoPhysicsTypes.H" +#include "KinematicCloud.H" + +#include "NoPostProcessing.H" +#include "PatchPostProcessing.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeSprayPostProcessingModels(ParcelType) \ + \ + makeSprayPostProcessingModelThermoType \ + ( \ + ParcelType, \ + constGasThermoPhysics \ + ); \ + \ + makeSprayPostProcessingModelThermoType \ + ( \ + ParcelType, \ + gasThermoPhysics \ + ); \ + \ + makeSprayPostProcessingModelThermoType \ + ( \ + ParcelType, \ + icoPoly8ThermoPhysics \ + ); + + +#define makeSprayPostProcessingModelThermoType(ParcelType, ThermoType) \ + \ + makePostProcessingModel(KinematicCloud >); \ + \ + makePostProcessingModelThermoType \ + ( \ + NoPostProcessing, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); \ + makePostProcessingModelThermoType \ + ( \ + PatchPostProcessing, \ + KinematicCloud, \ + ParcelType, \ + ThermoType \ + ); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.C b/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.C new file mode 100644 index 0000000000..bd96036e95 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "AtomizationModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::AtomizationModel::AtomizationModel +( + CloudType& owner +) +: + dict_(dictionary::null), + owner_(owner), + coeffDict_(dictionary::null) +{} + + +template +Foam::AtomizationModel::AtomizationModel +( + const dictionary& dict, + CloudType& owner, + const word& type +) +: + dict_(dict), + owner_(owner), + coeffDict_(dict.subDict(type + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::AtomizationModel::~AtomizationModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +const CloudType& Foam::AtomizationModel::owner() const +{ + return owner_; +} + + +template +const Foam::dictionary& Foam::AtomizationModel::dict() const +{ + return dict_; +} + + +template +const Foam::dictionary& Foam::AtomizationModel::coeffDict() const +{ + return coeffDict_; +} + + +template +Foam::scalar Foam::AtomizationModel::Taverage +( + const scalar& Tl, + const scalar& Tc +) const +{ + return (2.0*Tl + Tc)/3.0; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "NewAtomizationModel.C" + +// ************************************************************************* // + diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.H b/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.H new file mode 100644 index 0000000000..3e93597986 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.H @@ -0,0 +1,199 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::AtomizationModel + +Description + Templated phase change model class + +SourceFiles + AtomizationModel.C + NewAtomizationModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef AtomizationModel_H +#define AtomizationModel_H + +#include "IOdictionary.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class AtomizationModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class AtomizationModel +{ + +protected: + + // Protected data + + //- The cloud dictionary + const dictionary& dict_; + + //- Reference to the owner cloud class + CloudType& owner_; + + //- The coefficient dictionary + const dictionary coeffDict_; + +public: + + //- Runtime type information + TypeName("AtomizationModel"); + + //- Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + AtomizationModel, + dictionary, + ( + const dictionary& dict, + CloudType& owner + ), + (dict, owner) + ); + + + // Constructors + + //- Construct null from owner + AtomizationModel(CloudType& owner); + + //- Construct from dictionary + AtomizationModel + ( + const dictionary& dict, + CloudType& owner, + const word& type + ); + + + //- Destructor + virtual ~AtomizationModel(); + + + //- Selector + static autoPtr > New + ( + const dictionary& dict, + CloudType& owner + ); + + + // Access + + //- Return the owner cloud object + const CloudType& owner() const; + + //- Return the cloud dictionary + const dictionary& dict() const; + + //- Return the coefficient dictionary + const dictionary& coeffDict() const; + + + // Member Functions + + //- initial value of liquidCore + virtual scalar initLiquidCore() const = 0; + + //- Average temperature calculation + scalar Taverage(const scalar& Tliq, const scalar& Tc) const; + + //- flag to indicate if chi needs to be calculated + virtual bool calcChi() const = 0; + + virtual void update + ( + const scalar& dt, + scalar& d, + scalar& liquidCore, + scalar& tc, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const scalar& massflowRate, + const scalar& rhoAv, + const scalar& Urel, + const vector& pos, + const vector& injectionPos, + const scalar& pAmbient, + const scalar& chi, + Random& rndGen + ) const = 0; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeAtomizationModel(CloudType) \ + \ + defineNamedTemplateTypeNameAndDebug(AtomizationModel, 0); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + AtomizationModel, \ + dictionary \ + ); + +#define makeAtomizationModelThermoType(SS, CloudType, ParcelType, ThermoType) \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS > >, \ + 0 \ + ); \ + \ + AtomizationModel > >:: \ + adddictionaryConstructorToTable \ + > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "AtomizationModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/NewAtomizationModel.C b/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/NewAtomizationModel.C new file mode 100644 index 0000000000..a5f7ad439c --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/NewAtomizationModel.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "AtomizationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr > +Foam::AtomizationModel::New +( + const dictionary& dict, + CloudType& owner +) +{ + word AtomizationModelType(dict.lookup("AtomizationModel")); + + Info<< "Selecting AtomizationModel " << AtomizationModelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(AtomizationModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "AtomizationModel::New" + "(" + "const dictionary&, " + "CloudType&" + ")" + ) << "Unknown AtomizationModelType type " + << AtomizationModelType + << ", constructor not in hash table" << nl << nl + << " Valid AtomizationModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + } + + return autoPtr >(cstrIter()(dict, owner)); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C b/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C new file mode 100644 index 0000000000..b6262139e0 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "BlobsSheetAtomization.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::BlobsSheetAtomization::BlobsSheetAtomization +( + const dictionary& dict, + CloudType& owner +) +: + AtomizationModel(owner), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + B_(readScalar(coeffsDict_.lookup("B"))), + angle_(readScalar(coeffsDict_.lookup("angle"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::BlobsSheetAtomization::~BlobsSheetAtomization() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::scalar Foam::BlobsSheetAtomization::initLiquidCore() const +{ + return 1.0; +} + +template +bool Foam::BlobsSheetAtomization::calcChi() const +{ + return false; +} + +template +void Foam::BlobsSheetAtomization::update +( + const scalar& dt, + scalar& d, + scalar& liquidCore, + scalar& tc, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const scalar& massflowRate, + const scalar& rhoAv, + const scalar& Urel, + const vector& pos, + const vector& injectionPos, + const scalar& pAmbient, + const scalar& chi, + Random& rndGen +) const +{ + + scalar lBU = B_ * sqrt + ( + rho * sigma * d * cos(angle_*mathematicalConstant::pi/360.0) + / sqr(rhoAv*Urel) + ); + + scalar pWalk = mag(pos - injectionPos); + + if ( pWalk > lBU ) + { + liquidCore = 0.0; + } + +} + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H b/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H new file mode 100644 index 0000000000..99a307b2a7 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::BlobsSheetAtomization + +Description + Primary Breakup Model for pressure swirl atomizers. + + Accurate description in + @verbatim + Z. Han, S. Parrish, P.V. Farrell, R.D. Reitz + "Modeling Atomization Processes Of Pressure Swirl Hollow-Cone Fuel Sprays" + Atomization and Sprays, vol. 7, pp. 663-684, 1997 + + and + + L. Allocca, G. Bella, A. De Vita, L. Di Angelo + "Experimental Validation of a GDI Spray Model" + SAE Technical Paper Series, 2002-01-1137 + @endverbatim + + +\*---------------------------------------------------------------------------*/ + +#ifndef BlobsSheetAtomization_H +#define BlobsSheetAtomization_H + +#include "AtomizationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class BlobsSheetAtomization Declaration +\*---------------------------------------------------------------------------*/ + +template +class BlobsSheetAtomization +: + public AtomizationModel +{ +private: + + dictionary coeffsDict_; + scalar B_; + scalar angle_; + //Random& rndGen_; + +public: + + //- Runtime type information + TypeName("BlobsSheetAtomization"); + + + // Constructors + + //- Construct from dictionary + BlobsSheetAtomization(const dictionary& dict, CloudType& cloud); + + + //- Destructor + virtual ~BlobsSheetAtomization(); + + + // Member Functions + + //- initial value of liquidCore + virtual scalar initLiquidCore() const; + + //- flag to indicate if chi needs to be calculated + virtual bool calcChi() const; + + virtual void update + ( + const scalar& dt, + scalar& d, + scalar& liquidCore, + scalar& tc, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const scalar& massflowRate, + const scalar& rhoAv, + const scalar& Urel, + const vector& pos, + const vector& injectionPos, + const scalar& pAmbient, + const scalar& chi, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "BlobsSheetAtomization.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.C b/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.C new file mode 100644 index 0000000000..23f32b68c9 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.C @@ -0,0 +1,287 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "LISAAtomization.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::LISAAtomization::LISAAtomization +( + const dictionary& dict, + CloudType& owner +) +: + AtomizationModel(owner), + coeffsDict_(dict.subDict(typeName+"Coeffs")), + Cl_(readScalar(coeffsDict_.lookup("Cl"))), + cTau_(readScalar(coeffsDict_.lookup("cTau"))), + Q_(readScalar(coeffsDict_.lookup("Q"))), + lisaExp_(readScalar(coeffsDict_.lookup("lisaExp"))), + injectorDirection_(coeffsDict_.lookup("injectorDirection")), + SMDCalcMethod_(coeffsDict_.lookup("SMDCalculationMethod")) +{ + // NN. Would be good if this could be picked up from the injector + injectorDirection_ /= mag(injectorDirection_); + + if (SMDCalcMethod_ == "method1") + { + SMDMethod_ = method1; + } + else if (SMDCalcMethod_ == "method2") + { + SMDMethod_ = method2; + } + else + { + SMDMethod_ = method2; + Info << "Warning: SMDCalculationMethod " << SMDCalcMethod_ + << " unknown. Options are ( method1 | method2 ). Using method2" << endl; + } + +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::LISAAtomization::~LISAAtomization() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::scalar Foam::LISAAtomization::initLiquidCore() const +{ + return 1.0; +} + +template +bool Foam::LISAAtomization::calcChi() const +{ + return true; +} + +template +void Foam::LISAAtomization::update +( + const scalar& dt, + scalar& d, + scalar& liquidCore, + scalar& tc, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const scalar& massflowRate, + const scalar& rhoAv, + const scalar& Urel, + const vector& pos, + const vector& injectionPos, + const scalar& pAmbient, + const scalar& chi, + Random& rndGen +) const +{ + + if (massflowRate < SMALL) + { + return; + } + scalar tau = 0.0; + scalar dL = 0.0; + scalar k = 0.0; + + // update atomization characteristic time + tc += dt; + + scalar We = 0.5*rhoAv*pow(Urel, 2)*d/sigma; + scalar nu = mu/rho; + + scalar Q = rhoAv/rho; + + vector diff = pos - injectionPos; + scalar pWalk = mag(diff); + scalar traveledTime = pWalk/Urel; + + scalar h = diff & injectorDirection_; + scalar delta = sqrt(sqr(pWalk) - sqr(h)); + + scalar hSheet = massflowRate/(mathematicalConstant::pi*delta*rho*Urel); + + // update drop diameter + d = min(d, hSheet); + + if(We > 27.0/16.0) + { + + scalar kPos = 0.0; + scalar kNeg = Q*pow(Urel, 2.0)*rho/sigma; + + scalar derivativePos = sqrt + ( + Q*pow(Urel, 2.0) + ); + + scalar derivativeNeg = + ( + 8.0*pow(nu, 2.0)*pow(kNeg, 3.0) + + Q*pow(Urel, 2.0)*kNeg + - 3.0*sigma/2.0/rho*pow(kNeg, 2.0) + ) + / + sqrt + ( + 4.0*pow(nu, 2.0)*pow(kNeg, 4.0) + + Q*pow(Urel, 2.0)*pow(kNeg, 2.0) + - sigma*pow(kNeg, 3.0)/rho + ) + - + 4.0*nu*kNeg; + + scalar kOld = 0.0; + + for(label i=0; i<40; i++) + { + + k = kPos - (derivativePos/((derivativeNeg-derivativePos)/(kNeg-kPos))); + + scalar derivativek = + ( + 8.0*pow(nu, 2.0)*pow(k, 3.0) + + Q*pow(Urel, 2.0)*k + - 3.0*sigma/2.0/rho*pow(k, 2.0) + ) + / + sqrt + ( + 4.0*pow(nu, 2.0)*pow(k, 4.0) + + Q*pow(Urel, 2.0)*pow(k, 2.0) + - sigma*pow(k, 3.0)/rho + ) + - + 4.0*nu*k; + + if(derivativek > 0) + { + derivativePos = derivativek; + kPos = k; + } + else + { + derivativeNeg = derivativek; + kNeg = k; + } + + if(mag(k-kOld)/k < 1e-4) + { + break; + } + + kOld = k; + + } + + scalar omegaS = + - 2.0 * nu * pow(k, 2.0) + + sqrt + ( + 4.0*pow(nu, 2.0)*pow(k, 4.0) + + Q*pow(Urel, 2.0)*pow(k, 2.0) + - sigma*pow(k, 3.0)/rho + ); + + tau = cTau_/omegaS; + + dL = sqrt(8.0*d/k); + + } + else + { + + k = + rhoAv*pow(Urel, 2.0) + / + 2.0*sigma; + + // AL 101011 + //scalar J = pWalk*d/2.0; + scalar J = 0.5*traveledTime*hSheet; + + tau = pow(3.0*cTau_,2.0/3.0)*cbrt(J*sigma/(sqr(Q)*pow(Urel,4.0)*rho)); + + dL = sqrt(4.0*d/k); + } + + scalar kL = + 1.0 + / + ( + dL * + pow(0.5 + 1.5 * mu/pow((rho*sigma*dL), 0.5), 0.5) + ); + + scalar dD = cbrt(3.0*mathematicalConstant::pi*pow(dL, 2.0)/kL); + + scalar atmPressure = 1.0e+5; + + scalar pRatio = pAmbient/atmPressure; + + dD = dD*pow(pRatio, lisaExp_); + + scalar pExp = 0.135; + + // modifing dD to take account of flash boiling + dD = dD*(1.0 - chi*pow(pRatio, -pExp)); + scalar lBU = Cl_ * mag(Urel)*tau; + + if (pWalk > lBU) + { + scalar x = 0; + + switch (SMDMethod_) + { + case method1: + { + #include "LISASMDCalcMethod1.H" + break; + } + case method2: + { + #include "LISASMDCalcMethod2.H" + break; + } + } + + // New droplet properties + liquidCore = 0.0; + d = x; + tc = 0.0; + + } + +} + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.H b/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.H new file mode 100644 index 0000000000..34e6231697 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.H @@ -0,0 +1,148 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::LISAAtomization + +Description + Primary Breakup Model for pressure swirl atomizers. + + Accurate description in + @verbatim + P.K. Senecal, D.P. Schmidt, I. Nouar, C.J. Rutland, R.D. Reitz, M. Corradini + "Modeling high-speed viscous liquid sheet atomization" + International Journal of Multiphase Flow 25 (1999) pags. 1073-1097 + @endverbatim + + and + + @verbatim + D.P. Schmidt, I. Nouar, P.K. Senecal, C.J. Rutland, J.K. Martin, R.D. Reitz + "Pressure-Swirl Atomization in the Near Field" + SAE Techical Paper Series 1999-01-0496 + @endverbatim + +\*---------------------------------------------------------------------------*/ + +#ifndef LISAAtomization_H +#define LISAAtomization_H + +#include "AtomizationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class LISAAtomization Declaration +\*---------------------------------------------------------------------------*/ + +template +class LISAAtomization +: + public AtomizationModel +{ + +public: + + //- Enumeration for SMD calculations + enum SMDMethods + { + method1, method2 + }; + +private: + + // Private data + + dictionary coeffsDict_; + scalar Cl_; + scalar cTau_; + scalar Q_; + scalar lisaExp_; + vector injectorDirection_; + word SMDCalcMethod_; + + SMDMethods SMDMethod_; + +public: + + //- Runtime type information + TypeName("LISA"); + + + // Constructors + + //- Construct from dictionary + LISAAtomization(const dictionary&, CloudType&); + + + //- Destructor + virtual ~LISAAtomization(); + + + // Member Functions + + //- initial value of liquidCore + virtual scalar initLiquidCore() const; + + //- flag to indicate if chi needs to be calculated + virtual bool calcChi() const; + + virtual void update + ( + const scalar& dt, + scalar& d, + scalar& liquidCore, + scalar& tc, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const scalar& massflowRate, + const scalar& rhoAv, + const scalar& Urel, + const vector& pos, + const vector& injectionPos, + const scalar& pAmbient, + const scalar& chi, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "LISAAtomization.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H b/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H new file mode 100644 index 0000000000..932ec302d9 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H @@ -0,0 +1,33 @@ +{ + // calculate the new diameter with a Rosin Rammler distribution + + scalar minValue = min(d, dD/10.0); + scalar maxValue = dD; + + if(maxValue - minValue < SMALL) + { + minValue = d/10.0; + } + + scalar range = maxValue - minValue; + + scalar y = 0; + + bool success = false; + + while(!success) + { + + x = minValue + range*rndGen.scalar01(); + y = rndGen.scalar01(); + scalar p = 0.0; + scalar nExp = 1; + scalar xx = pow(x/dD, nExp); + + p = xx*exp(-xx); + if (yy) + { + success = true; + } + k++; + + } + //--------------------------------AL_____101012------------------------------// + // x = minValue + range*n/500; + x = minValue + range*(k-0.5)/500.0; + //------------------------------------END------------------------------------// +} diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.C b/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.C new file mode 100644 index 0000000000..fabf8d6fe7 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.C @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "NoAtomization.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::NoAtomization::NoAtomization +( + const dictionary& dict, + CloudType& owner +) +: + AtomizationModel(owner) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::NoAtomization::~NoAtomization() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::scalar Foam::NoAtomization::initLiquidCore() const +{ + return 0.0; +} + +template +bool Foam::NoAtomization::calcChi() const +{ + return false; +} + +template +void Foam::NoAtomization::update +( + const scalar& dt, + scalar& d, + scalar& liquidCore, + scalar& tc, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const scalar& massflowRate, + const scalar& rhoAv, + const scalar& Urel, + const vector& pos, + const vector& injectionPos, + const scalar& pAmbient, + const scalar& chi, + Random& rndGen +) const +{ +} + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.H b/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.H new file mode 100644 index 0000000000..08a669822a --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.H @@ -0,0 +1,110 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::NoAtomization + +Description + Dummy phase change model for 'none' + +\*---------------------------------------------------------------------------*/ + +#ifndef NoAtomization_H +#define NoAtomization_H + +#include "AtomizationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class NoAtomization Declaration +\*---------------------------------------------------------------------------*/ + +template +class NoAtomization +: + public AtomizationModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from dictionary + NoAtomization(const dictionary& dict, CloudType& cloud); + + + //- Destructor + virtual ~NoAtomization(); + + + // Member Functions + + //- initial value of liquidCore + virtual scalar initLiquidCore() const; + + //- flag to indicate if chi needs to be calculated + virtual bool calcChi() const; + + virtual void update + ( + const scalar& dt, + scalar& d, + scalar& liquidCore, + scalar& tc, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const scalar& massflowRate, + const scalar& rhoAv, + const scalar& Urel, + const vector& pos, + const vector& injectionPos, + const scalar& pAmbient, + const scalar& chi, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "NoAtomization.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.C new file mode 100644 index 0000000000..ffe0320bbf --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.C @@ -0,0 +1,111 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::BreakupModel::BreakupModel +( + CloudType& owner +) +: + dict_(dictionary::null), + owner_(owner), + coeffDict_(dictionary::null), + solveOscillationEq_(false), + y0_(0.0), + yDot0_(0.0), + TABComega_(0.0), + TABCmu_(0.0), + TABWeCrit_(0.0) +{} + + +template +Foam::BreakupModel::BreakupModel +( + const dictionary& dict, + CloudType& owner, + const word& type +) +: + dict_(dict), + owner_(owner), + coeffDict_(dict.subDict(type + "Coeffs")), + solveOscillationEq_(dict_.lookup("solveOscillationEq")), + y0_(0.0), + yDot0_(0.0), + TABComega_(0.0), + TABCmu_(0.0), + TABWeCrit_(0.0) +{ + if (solveOscillationEq_) + { + dictionary TABcoeffsDict(dict.subDict("TABCoeffs")); + y0_ = readScalar(TABcoeffsDict.lookup("y0")); + yDot0_ = readScalar(TABcoeffsDict.lookup("yDot0")); + TABComega_ = readScalar(TABcoeffsDict.lookup("Comega")); + TABCmu_ = readScalar(TABcoeffsDict.lookup("Cmu")); + TABWeCrit_ = readScalar(TABcoeffsDict.lookup("WeCrit")); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::BreakupModel::~BreakupModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +const CloudType& Foam::BreakupModel::owner() const +{ + return owner_; +} + + +template +const Foam::dictionary& Foam::BreakupModel::dict() const +{ + return dict_; +} + + +template +const Foam::dictionary& Foam::BreakupModel::coeffDict() const +{ + return coeffDict_; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "NewBreakupModel.C" + +// ************************************************************************* // + diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.H new file mode 100644 index 0000000000..89ca8cd092 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.H @@ -0,0 +1,239 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::BreakupModel + +Description + Templated phase change model class + +SourceFiles + BreakupModel.C + NewBreakupModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef BreakupModel_H +#define BreakupModel_H + +#include "IOdictionary.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class BreakupModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class BreakupModel +{ + +protected: + + // Protected data + + //- The cloud dictionary + const dictionary& dict_; + + //- Reference to the owner cloud class + CloudType& owner_; + + //- The coefficient dictionary + const dictionary coeffDict_; + + + Switch solveOscillationEq_; + + scalar y0_; + scalar yDot0_; + scalar TABComega_; + scalar TABCmu_; + scalar TABWeCrit_; + + +public: + + //- Runtime type information + TypeName("BreakupModel"); + + //- Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + BreakupModel, + dictionary, + ( + const dictionary& dict, + CloudType& owner + ), + (dict, owner) + ); + + + // Constructors + + //- Construct null from owner + BreakupModel(CloudType& owner); + + //- Construct from dictionary + BreakupModel + ( + const dictionary& dict, + CloudType& owner, + const word& type + ); + + + //- Destructor + virtual ~BreakupModel(); + + + //- Selector + static autoPtr > New + ( + const dictionary& dict, + CloudType& owner + ); + + + // Access + + //- Return the owner cloud object + const CloudType& owner() const; + + //- Return the cloud dictionary + const dictionary& dict() const; + + //- Return the coefficient dictionary + const dictionary& coeffDict() const; + + inline const Switch& solveOscillationEq() const + { + return solveOscillationEq_; + } + + inline const scalar& y0() const + { + return y0_; + } + + inline const scalar& yDot0() const + { + return yDot0_; + } + + inline const scalar& TABComega() const + { + return TABComega_; + } + + inline const scalar& TABCmu() const + { + return TABCmu_; + } + + inline const scalar& TABWeCrit() const + { + return TABWeCrit_; + } + + // Member Functions + + //- update the parcel properties and return true if a child parcel should be added + virtual bool update + ( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen + ) const = 0; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeBreakupModel(CloudType) \ + \ + defineNamedTemplateTypeNameAndDebug(BreakupModel, 0); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + BreakupModel, \ + dictionary \ + ); + + +#define makeBreakupModelThermoType(SS, CloudType, ParcelType, ThermoType) \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS > >, \ + 0 \ + ); \ + \ + BreakupModel > >:: \ + adddictionaryConstructorToTable \ + > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "BreakupModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/NewBreakupModel.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/NewBreakupModel.C new file mode 100644 index 0000000000..59dc6da1c4 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/NewBreakupModel.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr > +Foam::BreakupModel::New +( + const dictionary& dict, + CloudType& owner +) +{ + word BreakupModelType(dict.lookup("BreakupModel")); + + Info<< "Selecting BreakupModel " << BreakupModelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(BreakupModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "BreakupModel::New" + "(" + "const dictionary&, " + "CloudType&" + ")" + ) << "Unknown BreakupModelType type " + << BreakupModelType + << ", constructor not in hash table" << nl << nl + << " Valid BreakupModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + } + + return autoPtr >(cstrIter()(dict, owner)); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.C new file mode 100644 index 0000000000..c8192b7240 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.C @@ -0,0 +1,205 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "ETAB.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ETAB::ETAB +( + const dictionary& dict, + CloudType& owner +) +: + BreakupModel(dict, owner, typeName), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + Cmu_(readScalar(coeffsDict_.lookup("Cmu"))), + Comega_(readScalar(coeffsDict_.lookup("Comega"))), + k1_(readScalar(coeffsDict_.lookup("k1"))), + k2_(readScalar(coeffsDict_.lookup("k2"))), + WeCrit_(readScalar(coeffsDict_.lookup("WeCrit"))), + WeTransition_(readScalar(coeffsDict_.lookup("WeTransition"))), + AWe_(0.0) +{ + scalar k21 = k2_/k1_; + AWe_ = (k21*sqrt(WeTransition_) - 1.0)/pow(WeTransition_, 4.0); + + if (!BreakupModel::solveOscillationEq_) + { + Info << "Warning: solveOscillationEq is set to " << BreakupModel::solveOscillationEq_ + << endl + << " Setting it to true in order for the ETAB model to work." << endl; + BreakupModel::solveOscillationEq_ = true; + } + +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::ETAB::~ETAB() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::ETAB::update +( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen +) const +{ + scalar r = 0.5*d; + scalar r2 = r*r; + scalar r3 = r*r2; + + scalar semiMass = nParticle*pow(d, 3); + + // inverse of characteristic viscous damping time + scalar rtd = 0.5*Cmu_*mu/(rho*r2); + + // oscillation frequency (squared) + scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd; + + if (omega2 > 0) + { + scalar omega = sqrt(omega2); + scalar romega = 1.0/omega; + + scalar We = rhoc*pow(Urmag, 2.0)*r/sigma; + scalar Wetmp = We/WeCrit_; + + scalar y1 = y - Wetmp; + scalar y2 = yDot*romega; + + scalar a = sqrt(y1*y1 + y2*y2); + + // scotty we may have break-up + if (a+Wetmp > 1.0) + { + scalar phic = y1/a; + + // constrain phic within -1 to 1 + phic = max(min(phic, 1), -1); + + scalar phit = acos(phic); + scalar phi = phit; + scalar quad = -y2/a; + if (quad < 0) + { + phi = 2*mathematicalConstant::pi - phit; + } + + scalar tb = 0; + + if (mag(y) < 1.0) + { + scalar theta = acos((1.0 - Wetmp)/a); + + if (theta < phi) + { + if (2*mathematicalConstant::pi-theta >= phi) + { + theta = -theta; + } + theta += 2*mathematicalConstant::pi; + } + tb = (theta-phi)*romega; + + // breakup occurs + if (dt > tb) + { + y = 1.0; + yDot = -a*omega*sin(omega*tb + phi); + } + } + + // update droplet size + if (dt > tb) + { + scalar sqrtWe = AWe_*pow(We, 4.0) + 1.0; + scalar Kbr = k1_*omega*sqrtWe; + + if (We > WeTransition_) + { + sqrtWe = sqrt(We); + Kbr =k2_*omega*sqrtWe; + } + + scalar rWetmp = 1.0/Wetmp; + scalar cosdtbu = max(-1.0, min(1.0, 1.0-rWetmp)); + scalar dtbu = romega*acos(cosdtbu); + scalar decay = exp(-Kbr*dtbu); + + scalar rNew = decay*r; + if (rNew < r) + { + d = 2.0*rNew; + y = 0.0; + yDot = 0.0; + } + } + } + } + else + { + // reset droplet distortion parameters + y = 0; + yDot = 0; + } + + // update the nParticle count to conserve mass + nParticle = semiMass/pow(d, 3); + + // Do not add child parcel + return false; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.H new file mode 100644 index 0000000000..adaffe97d7 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.H @@ -0,0 +1,149 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::ETAB + +Description + The Enhanced TAB model. + + Described in the papers below. + @verbatim + F.X. Tanner + "Liquid Jet Atomization and Droplet Breakup Modeling of + Non-Evaporating Diesel Fuel Sprays" + SAE 970050, + SAE Transactions: Journal of Engines, Vol 106, Sec 3 pp 127-140 + + F.X. Tanner and G. Weisser + "Simulation of Liquid Jet Atomization for + Fuel Sprays by Means of Cascade Drop Breakup Model" + SAE 980808 + SAE Technical Paper Series + @endverbatim + +See Also + The TAB model + +\*---------------------------------------------------------------------------*/ + +#ifndef ETAB_H +#define ETAB_H + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class ETAB Declaration +\*---------------------------------------------------------------------------*/ + +template +class ETAB +: + public BreakupModel +{ +private: + + // Private data + + dictionary coeffsDict_; + + // model constants + + // Cmu_ and Comega_ are the same as in the TAB model + scalar Cmu_; + scalar Comega_; + + scalar k1_; + scalar k2_; + scalar WeCrit_; + scalar WeTransition_; + scalar AWe_; + +public: + + //- Runtime type information + TypeName("ETAB"); + + + // Constructors + + //- Construct from dictionary + ETAB(const dictionary&, CloudType&); + + + //- Destructor + virtual ~ETAB(); + + + // Member Functions + + //- update the parcel properties + virtual bool update + ( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ETAB.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.C new file mode 100644 index 0000000000..f6d570e7eb --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "NoBreakup.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::NoBreakup::NoBreakup +( + const dictionary&, + CloudType& owner +) +: + BreakupModel(owner) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::NoBreakup::~NoBreakup() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::NoBreakup::update +( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen +) const +{ + // Do nothing + return false; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.H new file mode 100644 index 0000000000..3c5f96309b --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.H @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::NoBreakup + +Description + Dummy breakup model for 'none' + +\*---------------------------------------------------------------------------*/ + +#ifndef NoBreakup_H +#define NoBreakup_H + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class NoBreakup Declaration +\*---------------------------------------------------------------------------*/ + +template +class NoBreakup +: + public BreakupModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from dictionary + NoBreakup(const dictionary&, CloudType&); + + + //- Destructor + virtual ~NoBreakup(); + + + // Member Functions + + //- update the parcel properties + virtual bool update + ( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "NoBreakup.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.C new file mode 100644 index 0000000000..e10c3e2a21 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.C @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "PilchErdman.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::PilchErdman::PilchErdman +( + const dictionary& dict, + CloudType& owner +) +: + BreakupModel(dict,owner, typeName), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + B1_(readScalar(coeffsDict_.lookup("B1"))), + B2_(readScalar(coeffsDict_.lookup("B2"))) +{} + + /* + These are the default values for this model... + static const scalar B1 = 0.375; + static const scalar B2 = 0.236; + */ + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::PilchErdman::~PilchErdman() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::PilchErdman::update +( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen +) const +{ + + scalar semiMass = nParticle*pow(d, 3); + scalar We = 0.5*rhoc*pow(Urmag, 2)*d/sigma; + //scalar nuc = muc/rhoc; + //scalar Re = Urmag*d/nuc; + scalar Oh = mu/pow(rho*d*sigma, 0.5); + + scalar Wec = 6.0*(1.0 + 1.077*pow(Oh, 1.6)); + + if (We > Wec) + { + + // We > 1335, wave crest stripping + scalar taubBar = 5.5; + + if (We > 175.0) + { + // sheet stripping + taubBar = 0.766*pow(2.0*We - 12.0, 0.25); + } + else if (We > 22.0) + { + // Bag-and-stamen breakup + taubBar = 14.1*pow(2.0*We - 12.0, -0.25); + } + else if (We > 9.0) + { + // Bag breakup + taubBar = 2.45*pow(2.0*We - 12.0, 0.25); + } + else if (We > 6.0) + { + // Vibrational breakup + taubBar = 6.0*pow(2.0*We - 12.0, -0.25); + } + + scalar rho12 = pow(rhoc/rho, 0.5); + + scalar Vd = Urmag*rho12*(B1_*taubBar * B2_*taubBar*taubBar); + scalar Vd1 = pow(1.0 - Vd/Urmag, 2.0); + Vd1 = max(Vd1, SMALL); + scalar Ds = 2.0*Wec*sigma*Vd1/(Vd1*rhoc*pow(Urmag, 2.0)); + scalar A = Urmag*rho12/d; + + scalar taub = taubBar/A; + + scalar frac = dt/taub; + + // update the droplet diameter according to the rate eq. (implicitly) + d = (d + frac*Ds)/(1.0 + frac); + + // correct the number of particles to conserve mass + nParticle = semiMass/pow(d, 3); + } + + return false; + +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.H new file mode 100644 index 0000000000..2d62b8823c --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.H @@ -0,0 +1,129 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::PilchErdman + +Description + secondary breakup model + + @verbatim + Pilch, M. and Erdman, C.A. + "Use of breakup time data and velocity history data + to predict the maximum size of stable fragments for acceleration + induced breakup of a liquid drop." + Int. J. Multiphase Flows 13 (1987), 741-757 + @endverbatim + +\*---------------------------------------------------------------------------*/ + +#ifndef PilchErdman_H +#define PilchErdman_H + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class PilchErdman Declaration +\*---------------------------------------------------------------------------*/ + +template +class PilchErdman +: + public BreakupModel +{ +private: + + // Private data + + dictionary coeffsDict_; + scalar B1_; + scalar B2_; + +public: + + //- Runtime type information + TypeName("PilchErdman"); + + + // Constructors + + //- Construct from dictionary + PilchErdman(const dictionary&, CloudType&); + + + //- Destructor + virtual ~PilchErdman(); + + + // Member Functions + + //- update the parcel properties + virtual bool update + ( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "PilchErdman.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.C new file mode 100644 index 0000000000..471499aabe --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.C @@ -0,0 +1,145 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "ReitzDiwakar.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ReitzDiwakar::ReitzDiwakar +( + const dictionary& dict, + CloudType& owner +) +: + BreakupModel(dict,owner, typeName), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + Cbag_(readScalar(coeffsDict_.lookup("Cbag"))), + Cb_(readScalar(coeffsDict_.lookup("Cb"))), + Cstrip_(readScalar(coeffsDict_.lookup("Cstrip"))), + Cs_(readScalar(coeffsDict_.lookup("Cs"))) +{} + + /* + These are the default values for this model... + static const scalar Cbag = 6.0; + static const scalar Cb = 0.785; + static const scalar Cstrip = 0.5; + static const scalar Cs = 10.0; + */ + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::ReitzDiwakar::~ReitzDiwakar() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::ReitzDiwakar::update +( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen +) const +{ + + scalar d1 = d; + scalar nuc = muc/rhoc; + scalar We = 0.5*rhoc*pow(Urmag, 2)*d/sigma; + scalar Re = Urmag*d/nuc; + + scalar sqRey = sqrt(Re); + + if (We > Cbag_) + { + if (We > Cstrip_*sqRey) + { + scalar dStrip = pow(2.0*Cstrip_*sigma, 2.0)/ + ( + rhoc*pow(Urmag, 3.0)*muc + ); + + scalar tauStrip = Cs_*d*sqrt(rho/rhoc)/Urmag; + scalar fraction = dt/tauStrip; + + // new droplet diameter, implicit calculation + d = (fraction*dStrip + d)/(1.0 + fraction); + } + else + { + scalar dBag = + 2.0 * Cbag_ * sigma + / ( + rhoc * pow(Urmag, 2.0) + ); + + scalar tauBag = + Cb_ * d + * sqrt + ( + rho * d / sigma + ); + + scalar fraction = dt/tauBag; + + // new droplet diameter, implicit calculation + d = (fraction*dBag + d)/(1.0 + fraction); + } + + // preserve the total mass/volume, by increasing the number of particles in parcels due to breakup + nParticle *= pow(d1/d, 3.0); + + } + + return false; + +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.H new file mode 100644 index 0000000000..7ba86856c0 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.H @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::ReitzDiwakar + +Description + secondary breakup model + + @verbatim + Reitz, R.D. + "Modelling atomization processes in highpressure vaporizing sprays" + Atomization and Spray Technology 3 (1987), 309-337 + @endverbatim + + @verbatim + Reitz, R.D. and Diwakar, R. + "Effect of drop breakup on fuel sprays" + SAE Tech. paper series, 860469 (1986) + @endverbatim + + @verbatim + Reitz, R.D. and Diwakar, R. + "Structure of high-pressure fuel sprays" + SAE Tech. paper series, 870598 (1987) + @endverbatim + +\*---------------------------------------------------------------------------*/ + +#ifndef ReitzDiwakar_H +#define ReitzDiwakar_H + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class ReitzDiwakar Declaration +\*---------------------------------------------------------------------------*/ + +template +class ReitzDiwakar +: + public BreakupModel +{ +private: + + // Private data + + dictionary coeffsDict_; + scalar Cbag_; + scalar Cb_; + scalar Cstrip_; + scalar Cs_; + +public: + + //- Runtime type information + TypeName("ReitzDiwakar"); + + + // Constructors + + //- Construct from dictionary + ReitzDiwakar(const dictionary&, CloudType&); + + + //- Destructor + virtual ~ReitzDiwakar(); + + + // Member Functions + + //- update the parcel properties + virtual bool update + ( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ReitzDiwakar.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.C new file mode 100644 index 0000000000..f957345532 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.C @@ -0,0 +1,239 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "ReitzKHRT.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ReitzKHRT::ReitzKHRT +( + const dictionary& dict, + CloudType& owner +) +: + BreakupModel(dict, owner, typeName), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + b0_(readScalar(coeffsDict_.lookup("B0"))), + b1_(readScalar(coeffsDict_.lookup("B1"))), + cTau_(readScalar(coeffsDict_.lookup("Ctau"))), + cRT_(readScalar(coeffsDict_.lookup("CRT"))), + msLimit_(readScalar(coeffsDict_.lookup("msLimit"))), + weberLimit_(readScalar(coeffsDict_.lookup("WeberLimit"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::ReitzKHRT::~ReitzKHRT() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::ReitzKHRT::update +( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen +) const +{ + bool addParcel = false; + + scalar r = 0.5*d; + scalar d3 = pow(d, 3.0); + scalar d03 = pow(d0, 3.0); + + scalar rhopi6 = rho*mathematicalConstant::pi/6.0; + scalar mass = nParticle*d3*rhopi6; + scalar mass0 = nParticle*d03*rhopi6; + + scalar weGas = 0.5*rhoc*pow(Urmag, 2)*d/sigma; + scalar weLiquid = 0.5*rho*pow(Urmag, 2)*d/sigma; + // Reitz is using radius instead of diameter for Re-number + scalar reLiquid = rho*Urmag*r/mu; + scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL); + scalar taylor = ohnesorge*sqrt(weGas); + + vector acceleration = Urel/tMom; + vector trajectory = U/mag(U); + scalar gt = (g + acceleration) & trajectory; + + // frequency of the fastest growing KH-wave + scalar omegaKH = + (0.34 + 0.38*pow(weGas, 1.5)) + /((1.0 + ohnesorge)*(1.0 + 1.4*pow(taylor, 0.6))) + *sqrt(sigma/(rho*pow(r, 3.0))); + + // corresponding KH wave-length. + scalar lambdaKH = + 9.02 + *r + *(1.0 + 0.45*sqrt(ohnesorge)) + *(1.0 + 0.4*pow(taylor, 0.7)) + /pow(1.0 + 0.865*pow(weGas, 1.67), 0.6); + + // characteristic Kelvin-Helmholtz breakup time + scalar tauKH = 3.726*b1_*r/(omegaKH*lambdaKH); + + // stable KH diameter + scalar dc = 2.0*b0_*lambdaKH; + + // the frequency of the fastest growing RT wavelength. + scalar helpVariable = mag(gt*(rho - rhoc)); + scalar omegaRT = sqrt + ( + 2.0*pow(helpVariable, 1.5) + /(3.0*sqrt(3.0*sigma)*(rhoc + rho)) + ); + + // RT wave number + scalar KRT = sqrt(helpVariable/(3.0*sigma + VSMALL)); + + // wavelength of the fastest growing RT frequency + scalar lambdaRT = 2.0*mathematicalConstant::pi*cRT_/(KRT + VSMALL); + + // if lambdaRT < diameter, then RT waves are growing on the surface + // and we start to keep track of how long they have been growing + if ((tc > 0) || (lambdaRT < d) ) + { + tc += dt; + scalar multiplier = d/lambdaRT; + d = cbrt(d3/multiplier); + } + + // characteristic RT breakup time + scalar tauRT = cTau_/(omegaRT + VSMALL); + + // check if we have RT breakup + if ((tc > tauRT) && (lambdaRT < d) ) + { + // the RT breakup creates diameter/lambdaRT new droplets + tc = -GREAT; + scalar nDrops = d/lambdaRT; + d = cbrt(d3/nDrops); + } + // otherwise check for KH breakup + else if (dc < d) + { + + // no breakup below Weber = 12 + if (weGas > weberLimit_) + { + scalar fraction = dt/tauKH; + + // reduce the diameter according to the rate-equation + d = (fraction*dc + d)/(1.0 + fraction); + + //scalar ms0 = rho*pow3(dc)*mathematicalConstant::pi/6.0; + scalar ms0 = mass0*(1.0 - pow(d/d0,3.0)); + ms += ms0; + + if (ms/averageParcelMass > msLimit_) + { + + //--------AL_____101201-------------// + // 2. Correct evaluation of the number of child droplets and the diameter of parcel droplets after breaukp + // Solution of cubic equation for the diameter of the parent drops after breakup, see Eq. 18 in Patterson & Reitz, SAE 980131 + bool br3 = true; + scalar ae3 = 1.; + scalar be3 = -dc; + scalar ce3 = 0.; + scalar de3 = d*d*(dc-d); + scalar qe3 = pow3(be3/(3.0*ae3)) - be3*ce3/(6.0*ae3*ae3) + de3/(2.0*ae3); + scalar pe3 = (3.0*ae3*ce3 - be3*be3)/(9.0*ae3*ae3); + scalar D3 = qe3*qe3 + pe3*pe3*pe3; + + if (D3 < 0) br3 = false; + + if (br3) + { + D3 = sqrt(D3); + scalar ue3 = cbrt(-qe3+D3); + scalar ve3 = cbrt(-qe3-D3); + scalar dParenDrops = ue3 + ve3 - be3/3.; + scalar mc = nParticle*(pow3(d)-pow3(dParenDrops)); + scalar nChildDrops = mc/pow3(dc); + + if (nChildDrops >= nParticle) + { + addParcel = true; + d = dParenDrops; + ms = 0.0; + dChild = dc; + massChild = mc*rhopi6; + + // reduce the parent mass by reducing nParticle + mass -= massChild; + + } + } + } + } + } + else if (KHindex < 0.5) + { + //--------AL_____101202-------------// + // 3. Case of larger drops after breakup (Reitz, Atomization & Spray Technology 3 (1987) 309-337, p.322) + // pIndKH() should be introduced + + scalar lengthScale = min(lambdaKH, 2.0*mathematicalConstant::pi*Urmag/omegaKH); + scalar diameterLargerDrop = cbrt(1.5*d*d*lengthScale); + d = diameterLargerDrop; + ms = 0.0; + KHindex = 1.0; + } + + // correct the number of parcels in parent + scalar massDrop = pow(d, 3)*rhopi6; + nParticle = mass/massDrop; + + return addParcel; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.H new file mode 100644 index 0000000000..86d81eeb1a --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.H @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::ReitzKHRT + +Description + secondary breakup model which uses the Kelvin-Helmholtz + instability theory to predict the 'stripped' droplets... and + the Raleigh-Taylor instability as well. + +\*---------------------------------------------------------------------------*/ + +#ifndef ReitzKHRT_H +#define ReitzKHRT_H + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class ReitzKHRT Declaration +\*---------------------------------------------------------------------------*/ + +template +class ReitzKHRT +: + public BreakupModel +{ +private: + + // Private data + + dictionary coeffsDict_; + + // model constants + scalar b0_; + scalar b1_; + scalar cTau_; + scalar cRT_; + scalar msLimit_; + scalar weberLimit_; + + +public: + + //- Runtime type information + TypeName("ReitzKHRT"); + + + // Constructors + + //- Construct from dictionary + ReitzKHRT(const dictionary&, CloudType&); + + + //- Destructor + virtual ~ReitzKHRT(); + + + // Member Functions + + //- update the parcel diameter + virtual bool update + ( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ReitzKHRT.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.C new file mode 100644 index 0000000000..a5de5e74ca --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.C @@ -0,0 +1,259 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "SHF.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::SHF::SHF +( + const dictionary& dict, + CloudType& owner +) +: + BreakupModel(dict, owner, typeName), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + weCorrCoeff_(readScalar(coeffsDict_.lookup("weCorrCoeff"))), + weBuCrit_(readScalar(coeffsDict_.lookup("weBuCrit"))), + weBuBag_(readScalar(coeffsDict_.lookup("weBuBag"))), + weBuMM_(readScalar(coeffsDict_.lookup("weBuMM"))), + ohnCoeffCrit_(readScalar(coeffsDict_.lookup("ohnCoeffCrit"))), + ohnCoeffBag_(readScalar(coeffsDict_.lookup("ohnCoeffBag"))), + ohnCoeffMM_(readScalar(coeffsDict_.lookup("ohnCoeffMM"))), + ohnExpCrit_(readScalar(coeffsDict_.lookup("ohnExpCrit"))), + ohnExpBag_(readScalar(coeffsDict_.lookup("ohnExpBag"))), + ohnExpMM_(readScalar(coeffsDict_.lookup("ohnExpMM"))), + cInit_(readScalar(coeffsDict_.lookup("Cinit"))), + c1_(readScalar(coeffsDict_.lookup("C1"))), + c2_(readScalar(coeffsDict_.lookup("C2"))), + c3_(readScalar(coeffsDict_.lookup("C3"))), + cExp1_(readScalar(coeffsDict_.lookup("Cexp1"))), + cExp2_(readScalar(coeffsDict_.lookup("Cexp2"))), + cExp3_(readScalar(coeffsDict_.lookup("Cexp3"))), + weConst_(readScalar(coeffsDict_.lookup("Weconst"))), + weCrit1_(readScalar(coeffsDict_.lookup("Wecrit1"))), + weCrit2_(readScalar(coeffsDict_.lookup("Wecrit2"))), + coeffD_(readScalar(coeffsDict_.lookup("CoeffD"))), + onExpD_(readScalar(coeffsDict_.lookup("OnExpD"))), + weExpD_(readScalar(coeffsDict_.lookup("WeExpD"))), + mu_(readScalar(coeffsDict_.lookup("mu"))), + sigma_(readScalar(coeffsDict_.lookup("sigma"))), + d32Coeff_(readScalar(coeffsDict_.lookup("d32Coeff"))), + cDmaxBM_(readScalar(coeffsDict_.lookup("cDmaxBM"))), + cDmaxS_(readScalar(coeffsDict_.lookup("cDmaxS"))), + corePerc_(readScalar(coeffsDict_.lookup("corePerc"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::SHF::~SHF() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::SHF::update +( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen +) const +{ + bool addChild = false; + + scalar d03 = pow(d, 3); + scalar rhopi6 = rho*mathematicalConstant::pi/6.0; + scalar mass0 = nParticle*rhopi6*d03; + scalar mass = mass0; + + scalar weGas = 0.5*rhoc*pow(Urmag, 2.0)*d/sigma; + scalar weLiquid = 0.5*rho*pow(Urmag, 2.0)*d/sigma; + + // correct the Reynolds number. Reitz is using radius instead of diameter + scalar reLiquid = 0.5*Urmag*d/mu; + scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL); + + vector acceleration = Urel/tMom; + vector trajectory = U/mag(U); + + scalar weGasCorr = weGas/(1.0 + weCorrCoeff_ * ohnesorge); + + // droplet deformation characteristic time + + scalar tChar = d/Urmag*sqrt(rho/rhoc); + + scalar tFirst = cInit_ * tChar; + + scalar tSecond = 0; + scalar tCharSecond = 0; + + bool bag = false; + bool multimode = false; + bool shear = false; + bool success = false; + + + // updating the droplet characteristic time + tc += dt; + + if(weGas > weConst_) + { + if(weGas < weCrit1_) + { + tCharSecond = c1_*pow((weGas - weConst_),cExp1_); + } + else if(weGas >= weCrit1_ && weGas <= weCrit2_) + { + tCharSecond = c2_*pow((weGas - weConst_),cExp2_); + } + else + { + tCharSecond = c3_*pow((weGas - weConst_),cExp3_); + } + } + + scalar weC = weBuCrit_*(1.0+ohnCoeffCrit_*pow(ohnesorge,ohnExpCrit_)); + scalar weB = weBuBag_*(1.0+ohnCoeffBag_*pow(ohnesorge, ohnExpBag_)); + scalar weMM = weBuMM_*(1.0+ohnCoeffMM_*pow(ohnesorge, ohnExpMM_)); + + if(weGas > weC && weGas < weB) + { + bag = true; + } + + if(weGas >= weB && weGas <= weMM) + { + multimode = true; + } + + if(weGas > weMM) + { + shear = true; + } + + tSecond = tCharSecond * tChar; + + scalar tBreakUP = tFirst + tSecond; + if(tc > tBreakUP) + { + + scalar d32 = coeffD_*d*pow(ohnesorge,onExpD_)*pow(weGasCorr,weExpD_); + + if(bag || multimode) + { + + scalar d05 = d32Coeff_ * d32; + + scalar x = 0.0; + scalar yGuess = 0.0; + scalar dGuess = 0.0; + + while(!success) + { + x = cDmaxBM_*rndGen.scalar01(); + dGuess = sqr(x)*d05; + yGuess = rndGen.scalar01(); + + scalar p = x/(2.0*sqrt(2.0*mathematicalConstant::pi)*sigma_)*exp(-0.5*sqr((x-mu_)/sigma_)); + + if (yGuess < p) + { + success = true; + } + } + + d = dGuess; + tc = 0.0; + } + + if(shear) + { + scalar dC = weConst_*sigma/(rhoc*sqr(Urmag)); + scalar d32Red = 4.0*(d32 * dC)/(5.0 * dC - d32); + + scalar d05 = d32Coeff_ * d32Red; + + scalar x = 0.0; + scalar yGuess = 0.0; + scalar dGuess = 0.0; + + while(!success) + { + + x = cDmaxS_*rndGen.scalar01(); + dGuess = sqr(x)*d05; + yGuess = rndGen.scalar01(); + + scalar p = x/(2.0*sqrt(2.0*mathematicalConstant::pi)*sigma_)*exp(-0.5*sqr((x-mu_)/sigma_)); + + if (yGuess. + +Class + Foam::SHF + +Description + Secondary Breakup Model to take account of the different breakup regimes, + bag, molutimode, shear.... + + Accurate description in + @verbatim + R. Schmehl, G. Maier, S. Witting + "CFD Analysis of Fuel Atomization, Secondary Droplet Breakup and Spray + Dispersion in the Premix Duct of a LPP Combustor". + Eight International Conference on Liquid Atomization and Spray Systems, 2000 + @endverbatim + +\*---------------------------------------------------------------------------*/ + +#ifndef SHF_H +#define SHF_H + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class SHF Declaration +\*---------------------------------------------------------------------------*/ + +template +class SHF +: + public BreakupModel +{ +private: + + // Private data + + dictionary coeffsDict_; + + // model constants + + scalar weCorrCoeff_; + + scalar weBuCrit_; + scalar weBuBag_; + scalar weBuMM_; + + scalar ohnCoeffCrit_; + scalar ohnCoeffBag_; + scalar ohnCoeffMM_; + + scalar ohnExpCrit_; + scalar ohnExpBag_; + scalar ohnExpMM_; + + scalar cInit_; + + scalar c1_; + scalar c2_; + scalar c3_; + + scalar cExp1_; + scalar cExp2_; + scalar cExp3_; + + scalar weConst_; + scalar weCrit1_; + scalar weCrit2_; + + scalar coeffD_; + scalar onExpD_; + scalar weExpD_; + + scalar mu_; + scalar sigma_; + + scalar d32Coeff_; + scalar cDmaxBM_; + scalar cDmaxS_; + + scalar corePerc_; + +public: + + //- Runtime type information + TypeName("SHF"); + + + // Constructors + + //- Construct from dictionary + SHF(const dictionary&, CloudType&); + + + //- Destructor + virtual ~SHF(); + + + // Member Functions + + //- update the parcel properties + virtual bool update + ( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "SHF.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.C new file mode 100644 index 0000000000..bed2e72386 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.C @@ -0,0 +1,245 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "TAB.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::TAB::TAB +( + const dictionary& dict, + CloudType& owner +) +: + BreakupModel(dict, owner, typeName), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + Cmu_(BreakupModel::TABCmu_), + Comega_(BreakupModel::TABComega_), + WeCrit_(BreakupModel::TABWeCrit_), + SMDCalcMethod_(coeffsDict_.lookup("SMDCalculationMethod")) +{ + + // calculate the inverse function of the Rossin-Rammler Distribution + const scalar xx0 = 12.0; + const scalar rrd100 = 1.0/(1.0-exp(-xx0)*(1.0+xx0+pow(xx0, 2.0)/2.0 + pow(xx0, 3.0)/6.0)); + + for(label n=0; n<100; n++) + { + scalar xx = 0.12*(n+1); + rrd_[n] = (1.0 - exp(-xx)*(1.0 + xx + pow(xx, 2.0)/2.0 + pow(xx, 3.0)/6.0))*rrd100; + } + + if (!BreakupModel::solveOscillationEq_) + { + Info << "Warning: solveOscillationEq is set to " << BreakupModel::solveOscillationEq_ + << endl + << " Setting it to true in order for the TAB model to work." << endl; + BreakupModel::solveOscillationEq_ = true; + } + + if (SMDCalcMethod_ == "method1") + { + SMDMethod_ = method1; + } + else if (SMDCalcMethod_ == "method2") + { + SMDMethod_ = method2; + } + else + { + SMDMethod_ = method2; + Info << "Warning: SMDCalculationMethod unknown. Options are ( method1 | method2 ). Using method2" << endl; + } + +} + + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::TAB::~TAB() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::TAB::update +( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen +) const +{ + + scalar r = 0.5*d; + scalar r2 = r*r; + scalar r3 = r*r2; + + scalar semiMass = nParticle*pow(d, 3); + + // inverse of characteristic viscous damping time + scalar rtd = 0.5*Cmu_*mu/(rho*r2); + + // oscillation frequency (squared) + scalar omega2 = Comega_*sigma/(rho*r3) - rtd*rtd; + + if (omega2 > 0) + { + scalar omega = sqrt(omega2); + scalar We = rhoc*pow(Urmag, 2.0)*r/sigma; + scalar Wetmp = We/WeCrit_; + + scalar y1 = y - Wetmp; + scalar y2 = yDot/omega; + + scalar a = sqrt(y1*y1 + y2*y2); + + // scotty we may have break-up + if (a+Wetmp > 1.0) + { + scalar phic = y1/a; + + // constrain phic within -1 to 1 + phic = max(min(phic, 1), -1); + + scalar phit = acos(phic); + scalar phi = phit; + scalar quad = -y2/a; + if (quad < 0) + { + phi = 2*mathematicalConstant::pi - phit; + } + + scalar tb = 0; + + if (mag(y) < 1.0) + { + scalar coste = 1.0; + if + ( + (Wetmp - a < -1) && (yDot < 0) + ) + { + coste = -1.0; + } + + scalar theta = acos((coste-Wetmp)/a); + + if (theta < phi) + { + if (2*mathematicalConstant::pi-theta >= phi) + { + theta = -theta; + } + theta += 2*mathematicalConstant::pi; + } + tb = (theta-phi)/omega; + + // breakup occurs + if (dt > tb) + { + y = 1.0; + yDot = -a*omega*sin(omega*tb + phi); + } + + } + + // update droplet size + if (dt > tb) + { + scalar rs = r/ + ( + 1.0 + + (4.0/3.0)*pow(y, 2) + + rho*r3/(8*sigma)*pow(yDot, 2) + ); + + label n = 0; + scalar rNew = 0.0; + switch (SMDMethod_) + { + case method1: + { + #include "TABSMDCalcMethod1.H" + break; + } + case method2: + { + #include "TABSMDCalcMethod2.H" + break; + } + } + + if (rNew < r) + { + d = 2*rNew; + y = 0; + yDot = 0; + } + + } + + } + + } + else + { + // reset droplet distortion parameters + y = 0; + yDot = 0; + } + + // update the nParticle count to conserve mass + nParticle = semiMass/pow(d, 3); + + // Do not add child parcel + return false; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.H new file mode 100644 index 0000000000..420a546b86 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.H @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::TAB + +Description + The TAB Method for Numerical Calculation of Spray Droplet Breakup. + + @verbatim + O'Rourke, P.J. and Amsden, A.A., + "The TAB Method for Numerical Calculation of Spray Droplet Breakup," + 1987 SAE International Fuels and Lubricants Meeting and Exposition, + Toronto, Ontario, November 2-5, 1987, + Los Alamos National Laboratory document LA-UR-87-2105; + SAE Technical Paper Series, Paper 872089. + @endverbatim + + This implementation follows the kiva version. + +See Also + The Enhanced %TAB model - ETAB + +\*---------------------------------------------------------------------------*/ + +#ifndef TAB_H +#define TAB_H + +#include "BreakupModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class TAB Declaration +\*---------------------------------------------------------------------------*/ + +template +class TAB +: + public BreakupModel +{ +public: + //- Enumeration for the SMD brekup calculation + enum SMDMethods + { + method1, method2 + }; + +private: + // Private data + + dictionary coeffsDict_; + + // inverse function approximation + // of the Rossin-Rammler Distribution + // used when calculating the droplet size after breakup + scalar rrd_[100]; + + // model constants + + scalar Cmu_; + scalar Comega_; + scalar WeCrit_; + word SMDCalcMethod_; + SMDMethods SMDMethod_; + +public: + + //- Runtime type information + TypeName("TAB"); + + + // Constructors + + //- Construct from dictionary + TAB(const dictionary&, CloudType&); + + + //- Destructor + virtual ~TAB(); + + + // Member Functions + + //- update the parcel diameter + virtual bool update + ( + const scalar& dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar& d0, + const scalar& rho, + const scalar& mu, + const scalar& sigma, + const vector& U, + const scalar& rhoc, + const scalar& muc, + const vector& Urel, + const scalar& Urmag, + const scalar& tMom, + const scalar& averageParcelMass, + scalar& dChild, + scalar& massChild, + Random& rndGen + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "TAB.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod1.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod1.H new file mode 100644 index 0000000000..9aeb6b216f --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod1.H @@ -0,0 +1,15 @@ +{ + bool found = false; + scalar random = rndGen.scalar01(); + while (!found && (n<99)) + { + if (rrd_[n]>random) + { + found = true; + } + n++; + } + rNew = 0.04*n*rs; +} + + diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod2.H b/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod2.H new file mode 100644 index 0000000000..d44fa4401c --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod2.H @@ -0,0 +1,54 @@ +{ + + //-----AL_____101012------------------------------// + // Calculation of the mean radius based on SMR rs. Coefficient factorGamma depends on nExp. + scalar factorGamma = 1.; + scalar delta = rs/factorGamma; + + scalar minValue = min (d/2.0, 0.04*rs); + scalar maxValue = rs*4.0; + + scalar range = maxValue - minValue; + + if(maxValue - minValue < SMALL) + { + //--------------------------------AL_____101015------------------------------// + minValue = d/20.0; + maxValue = d; + //-----------------------------------END-------------------------------------// + } + + scalar nExp = 3.5; + scalar rrd[100]; + //--------------------------------AL_____101012------------------------------// + scalar probFactorMin = exp(-pow(minValue/delta,nExp)); + scalar probFactorMax = exp(-pow(maxValue/delta,nExp)); + scalar probFactor = 1./(probFactorMin - probFactorMax); + //-----------------------------------END-------------------------------------// + for(label n=0; n<100; n++) + { + scalar xx = minValue + range*n/100; + //-------------------------------A-L_____101012------------------------------// + rrd[n] = (probFactorMin - exp(-pow(xx/delta,nExp)))*probFactor; + //-----------------------------------END-------------------------------------// + } + + label n = 0; + bool found = false; + scalar random = rndGen.scalar01(); + + while (!found && (n<100)) + { + if (rrd[n]>random) + { + found = true; + } + n++; + + } + //--------------------------------AL_____101012------------------------------// + // rNew = minValue + range*n/100; + rNew = minValue + range*(n-0.5)/100.0; + //------------------------------------END------------------------------------// + +} diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.C b/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.C new file mode 100644 index 0000000000..1aafc9af13 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.C @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "CollisionModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::CollisionModel::CollisionModel +( + CloudType& owner +) +: + dict_(dictionary::null), + owner_(owner), + coeffDict_(dictionary::null) +{} + + +template +Foam::CollisionModel::CollisionModel +( + const dictionary& dict, + CloudType& owner, + const word& type +) +: + dict_(dict), + owner_(owner), + coeffDict_(dict.subDict(type + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::CollisionModel::~CollisionModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +const CloudType& Foam::CollisionModel::owner() const +{ + return owner_; +} + + +template +const Foam::dictionary& Foam::CollisionModel::dict() const +{ + return dict_; +} + + +template +const Foam::dictionary& Foam::CollisionModel::coeffDict() const +{ + return coeffDict_; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "NewCollisionModel.C" + +// ************************************************************************* // + diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.H b/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.H new file mode 100644 index 0000000000..09c5237a83 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.H @@ -0,0 +1,201 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::CollisionModel + +Description + Templated phase change model class + +SourceFiles + CollisionModel.C + NewCollisionModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CollisionModel_H +#define CollisionModel_H + +#include "IOdictionary.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class CollisionModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class CollisionModel +{ + +protected: + + // Protected data + + //- The cloud dictionary + const dictionary& dict_; + + //- Reference to the owner cloud class + CloudType& owner_; + + //- The coefficient dictionary + const dictionary coeffDict_; + +public: + + //- Runtime type information + TypeName("CollisionModel"); + + //- Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + CollisionModel, + dictionary, + ( + const dictionary& dict, + CloudType& owner + ), + (dict, owner) + ); + + + // Constructors + + //- Construct null from owner + CollisionModel(CloudType& owner); + + //- Construct from dictionary + CollisionModel + ( + const dictionary& dict, + CloudType& owner, + const word& type + ); + + + //- Destructor + virtual ~CollisionModel(); + + + //- Selector + static autoPtr > New + ( + const dictionary& dict, + CloudType& owner + ); + + + // Access + + //- Return the owner cloud object + const CloudType& owner() const; + + //- Return the cloud dictionary + const dictionary& dict() const; + + //- Return the coefficient dictionary + const dictionary& coeffDict() const; + + + // Member Functions + + virtual bool active() const = 0; + + virtual bool update + ( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U1, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj + ) const = 0; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define makeCollisionModel(CloudType) \ + \ + defineNamedTemplateTypeNameAndDebug(CollisionModel, 0); \ + \ + defineTemplateRunTimeSelectionTable \ + ( \ + CollisionModel, \ + dictionary \ + ); + +#define makeCollisionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ + \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + SS > >, \ + 0 \ + ); \ + \ + CollisionModel > >:: \ + adddictionaryConstructorToTable \ + > > > \ + add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "CollisionModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/NewCollisionModel.C b/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/NewCollisionModel.C new file mode 100644 index 0000000000..f8e7c1bf51 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/NewCollisionModel.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "CollisionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +Foam::autoPtr > +Foam::CollisionModel::New +( + const dictionary& dict, + CloudType& owner +) +{ + word CollisionModelType(dict.lookup("CollisionModel")); + + Info<< "Selecting CollisionModel " << CollisionModelType << endl; + + typename dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(CollisionModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "CollisionModel::New" + "(" + "const dictionary&, " + "CloudType&" + ")" + ) << "Unknown CollisionModelType type " + << CollisionModelType + << ", constructor not in hash table" << nl << nl + << " Valid CollisionModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); + } + + return autoPtr >(cstrIter()(dict, owner)); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.C b/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.C new file mode 100644 index 0000000000..373684c5a6 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.C @@ -0,0 +1,88 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "NoCollision.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::NoCollision::NoCollision +( + const dictionary& dict, + CloudType& owner +) +: + CollisionModel(owner) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::NoCollision::~NoCollision() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::NoCollision::active() const +{ + return false; +} + +template +bool Foam::NoCollision::update +( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj +) const +{ + return false; +} + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.H b/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.H new file mode 100644 index 0000000000..fcdccfc6d9 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.H @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::NoCollision + +Description + Dummy collision model for 'none' + +\*---------------------------------------------------------------------------*/ + +#ifndef NoCollision_H +#define NoCollision_H + +#include "CollisionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class NoCollision Declaration +\*---------------------------------------------------------------------------*/ + +template +class NoCollision +: + public CollisionModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from dictionary + NoCollision + ( + const dictionary& dict, + CloudType& cloud + ); + + + //- Destructor + virtual ~NoCollision(); + + + // Member Functions + + virtual bool active() const; + + virtual bool update + ( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "NoCollision.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.C b/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.C new file mode 100644 index 0000000000..0bc3a6a19e --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.C @@ -0,0 +1,294 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "ORourkeCollision.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::ORourkeCollision::ORourkeCollision +( + const dictionary& dict, + CloudType& owner +) +: + CollisionModel(owner), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + coalescence_(coeffsDict_.lookup("coalescence")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::ORourkeCollision::~ORourkeCollision() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::ORourkeCollision::active() const +{ + return true; +} + +template +bool Foam::ORourkeCollision::update +( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U1, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj +) const +{ + // check if parcels belong to same cell + if ((celli != cellj) || (m1 < VSMALL) || (m2 < VSMALL)) + { + return false; + } + bool coalescence = false; + + scalar magVrel = mag(U1-U2); + scalar sumD = d1 + d2; + scalar nu0 = 0.25*mathematicalConstant::pi*sumD*sumD*magVrel*dt/volj; + scalar nMin = min(N1, N2); + scalar nu = nMin*nu0; + scalar collProb = exp(-nu); + scalar xx = rndGen.scalar01(); + + // collision occur + if ( xx > collProb) + { + + if (d1 > d2) + { + coalescence = collideSorted + ( + dt, + rndGen, + pos1, + m1, + d1, + N1, + U1, + rho1, + T1, + Y1, + sigma1, + celli, + voli, + pos2, + m2, + d2, + N2, + U2, + rho2, + T2, + Y2, + sigma2, + cellj, + volj + ); + } + else + { + coalescence = collideSorted + ( + dt, + rndGen, + pos2, + m2, + d2, + N2, + U2, + rho2, + T2, + Y2, + sigma2, + cellj, + volj, + pos1, + m1, + d1, + N1, + U1, + rho1, + T1, + Y1, + sigma1, + celli, + voli + ); + } + } + return coalescence; +} + + +template +bool Foam::ORourkeCollision::collideSorted +( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U1, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj +) const +{ + bool coalescence = false; + + vector vRel = U1 - U2; + scalar magVRel = mag(vRel); + + scalar mdMin = m2/N2; + + scalar mTot = m1 + m2; + + scalar gamma = d1/max(d2, 1.0e-12); + scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma; + + vector momMax = m1*U1; + vector momMin = m2*U2; + + // use mass-averaged temperature to calculate We number + scalar Tm = (T1*m1 + T2*m2)/mTot; + + // interpolate the averaged surface tension + scalar sigma = sigma1 + (sigma2 - sigma1)*(Tm - T1)/(T2 - T1); + + sigma = max(1.0e-6, sigma); + scalar Vtot = m1/rho1 + m2/rho2; + scalar rho = mTot/Vtot; + + scalar dMean = sqrt(d1*d2); + scalar WeColl = max(1.0e-12, 0.5*rho*magVRel*magVRel*dMean/sigma); + + scalar coalesceProb = min(1.0, 2.4*f/WeColl); + + scalar prob = rndGen.scalar01(); + + // Coalescence + if ( prob < coalesceProb && coalescence_) + { + coalescence = true; + // How 'many' of the droplets coalesce + scalar nProb = prob*N2/N1; + + // Conservation of mass, momentum and energy + scalar m2Org = m2; + scalar dm = N1*nProb*mdMin; + m2 -= dm; + scalar V2 = mathematicalConstant::pi*pow(d2, 3.0)/6.0; + N2 = m2/(rho2*V2); + + scalar m1Org = m1; + m1 += dm; + T1 = (Tm*mTot - m2*T2)/m1; + + U1 =(momMax + (1.0 - m2/m2Org)*momMin)/m1; + + // update the liquid mass fractions + Y1 = (m1Org*Y1 + dm*Y2)/m1; + + } + // Grazing collision (no coalescence) + else + { + scalar gf = sqrt(prob) - sqrt(coalesceProb); + scalar denom = 1.0 - sqrt(coalesceProb); + if (denom < 1.0e-5) + { + denom = 1.0; + } + gf /= denom; + + // if gf negative, this means that coalescence is turned off + // and these parcels should have coalesced + gf = max(0.0, gf); + + // gf -> 1 => v1p -> p1().U() ... + // gf -> 0 => v1p -> momentum/(m1+m2) + + vector mr = m1*U1 + m2*U2; + vector v1p = (mr + m2*gf*vRel)/(m1+m2); + vector v2p = (mr - m1*gf*vRel)/(m1+m2); + + if (N1 < N2) + { + U1 = v1p; + U2 = (N1*v2p + (N2-N1)*U2)/N2; + } + else + { + U1 = (N2*v1p + (N1-N2)*U1)/N1; + U2 = v2p; + } + + } // if - coalescence or not + + return coalescence; +} + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.H b/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.H new file mode 100644 index 0000000000..bbb968f04a --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::ORourkeCollision + +Description + Collision model by P.J. O'Rourke. + + +\*---------------------------------------------------------------------------*/ + +#ifndef ORourkeCollision_H +#define ORourkeCollision_H + +#include "CollisionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class ORourkeCollision Declaration +\*---------------------------------------------------------------------------*/ + +template +class ORourkeCollision +: + public CollisionModel +{ +private: + + dictionary coeffsDict_; + Switch coalescence_; + +public: + + //- Runtime type information + TypeName("ORourke"); + + + // Constructors + + //- Construct from dictionary + ORourkeCollision + ( + const dictionary& dict, + CloudType& cloud + ); + + + //- Destructor + virtual ~ORourkeCollision(); + + + // Member Functions + + virtual bool active() const; + + virtual bool update + ( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj + ) const; + + + // 1 is the larger drop and 2 is the smaller + bool collideSorted + ( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ORourkeCollision.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.C b/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.C new file mode 100644 index 0000000000..3acb1dd07c --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.C @@ -0,0 +1,342 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "TrajectoryCollision.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::TrajectoryCollision::TrajectoryCollision +( + const dictionary& dict, + CloudType& owner +) +: + CollisionModel(owner), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + cSpace_(readScalar(coeffsDict_.lookup("cSpace"))), + cTime_(readScalar(coeffsDict_.lookup("cTime"))), + coalescence_(coeffsDict_.lookup("coalescence")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::TrajectoryCollision::~TrajectoryCollision() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::TrajectoryCollision::active() const +{ + return true; +} + +template +bool Foam::TrajectoryCollision::update +( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U1, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj +) const +{ + bool coalescence = false; + + vector vRel = U1 - U2; + // scalar magVRel = mag(vRel); + + vector p = pos2 - pos1; + scalar dist = mag(p); + + scalar vAlign = vRel & (p/(dist+SMALL)); + + if (vAlign > 0) + { + scalar sumD = d1 + d2; + + if (vAlign*dt > dist - 0.5*sumD) + { + scalar v1Mag = mag(U1); + scalar v2Mag = mag(U2); + vector nv1 = U1/v1Mag; + vector nv2 = U2/v2Mag; + + scalar v1v2 = nv1 & nv2; + scalar v1p = nv1 & p; + scalar v2p = nv2 & p; + + scalar det = 1.0 - v1v2*v1v2; + + scalar alpha = 1.0e+20; + scalar beta = 1.0e+20; + + if (mag(det) > 1.0e-4) + { + beta = -(v2p - v1v2*v1p)/det; + alpha = v1p + v1v2*beta; + } + + alpha /= v1Mag*dt; + beta /= v2Mag*dt; + + // is collision possible within this timestep + if ((alpha>0) && (alpha<1.0) && (beta>0) && (beta<1.0)) + { + vector p1c = pos1 + alpha*U1*dt; + vector p2c = pos2 + beta*U2*dt; + + scalar closestDist = mag(p1c-p2c); + + scalar collProb = + pow(0.5*sumD/max(0.5*sumD, closestDist), cSpace_) + * exp(-cTime_*mag(alpha-beta)); + + scalar xx = rndGen.scalar01(); + + // collision occur + if ((xx < collProb) && (m1 > VSMALL) && (m2 > VSMALL)) + { + if (d1 > d2) + { + coalescence = collideSorted + ( + dt, + rndGen, + pos1, + m1, + d1, + N1, + U1, + rho1, + T1, + Y1, + sigma1, + celli, + voli, + pos2, + m2, + d2, + N2, + U2, + rho2, + T2, + Y2, + sigma2, + cellj, + volj + ); + } + else + { + coalescence = collideSorted + ( + dt, + rndGen, + pos2, + m2, + d2, + N2, + U2, + rho2, + T2, + Y2, + sigma2, + cellj, + volj, + pos1, + m1, + d1, + N1, + U1, + rho1, + T1, + Y1, + sigma1, + celli, + voli + ); + } + } // if ( d1 > d2 ) + + } // if - possible collision (alpha, beta) in timeinterval + + } // if - travelled distance is larger distance between parcels + + } + + return coalescence; +} + + +template +bool Foam::TrajectoryCollision::collideSorted +( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U1, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj +) const +{ + bool coalescence = false; + + vector vRel = U1 - U2; + scalar magVRel = mag(vRel); + + scalar mdMin = m2/N2; + + scalar mTot = m1 + m2; + + scalar gamma = d1/max(d2, 1.0e-12); + scalar f = gamma*gamma*gamma + 2.7*gamma - 2.4*gamma*gamma; + + vector momMax = m1*U1; + vector momMin = m2*U2; + + // use mass-averaged temperature to calculate We number + scalar Tm = (T1*m1 + T2*m2)/mTot; + + // and mass averaged fractions ... + //scalarField Yav((m1*Y1 + m2*Y2)/mTot; + + // interpolate the averaged surface tension + scalar sigma = sigma1 + (sigma2 - sigma1)*(Tm - T1)/(T2 - T1); + + sigma = max(1.0e-6, sigma); + scalar Vtot = m1/rho1 + m2/rho2; + scalar rho = mTot/Vtot; + + scalar dMean = sqrt(d1*d2); + scalar WeColl = max(1.0e-12, 0.5*rho*magVRel*magVRel*dMean/sigma); + + scalar coalesceProb = min(1.0, 2.4*f/WeColl); + + scalar prob = rndGen.scalar01(); + + // Coalescence + if ( prob < coalesceProb && coalescence_) + { + coalescence = true; + // How 'many' of the droplets coalesce + scalar nProb = prob*N2/N1; + + // Conservation of mass, momentum and energy + scalar m2Org = m2; + scalar dm = N1*nProb*mdMin; + m2 -= dm; + scalar V2 = mathematicalConstant::pi*pow(d2, 3.0)/6.0; + N2 = m2/(rho2*V2); + + scalar m1Org = m1; + m1 += dm; + T1 = (Tm*mTot - m2*T2)/m1; + + U1 =(momMax + (1.0 - m2/m2Org)*momMin)/m1; + + // update the liquid mass fractions + Y1 = (m1Org*Y1 + dm*Y2)/m1; + + } + // Grazing collision (no coalescence) + else + { + scalar gf = sqrt(prob) - sqrt(coalesceProb); + scalar denom = 1.0 - sqrt(coalesceProb); + if (denom < 1.0e-5) { + denom = 1.0; + } + gf /= denom; + + // if gf negative, this means that coalescence is turned off + // and these parcels should have coalesced + gf = max(0.0, gf); + + // gf -> 1 => v1p -> p1().U() ... + // gf -> 0 => v1p -> momentum/(m1+m2) + + vector mr = m1*U1 + m2*U2; + vector v1p = (mr + m2*gf*vRel)/(m1+m2); + vector v2p = (mr - m1*gf*vRel)/(m1+m2); + + if (N1 < N2) + { + U1 = v1p; + U2 = (N1*v2p + (N2-N1)*U2)/N2; + } + else + { + U1 = (N2*v1p + (N1-N2)*U1)/N1; + U2 = v2p; + } + + } // if - coalescence or not + + return coalescence; +} + +// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.H b/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.H new file mode 100644 index 0000000000..092c65b2a3 --- /dev/null +++ b/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::TrajectoryCollision + +Description + Trajectory collision model by N. Nordin. + +\*---------------------------------------------------------------------------*/ + +#ifndef TrajectoryCollision_H +#define TrajectoryCollision_H + +#include "CollisionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class TrajectoryCollision Declaration +\*---------------------------------------------------------------------------*/ + +template +class TrajectoryCollision +: + public CollisionModel +{ +private: + // Reference to the coefficients dictionary + dictionary coeffsDict_; + + scalar cSpace_; + scalar cTime_; + Switch coalescence_; +public: + + //- Runtime type information + TypeName("Trajectory"); + + + // Constructors + + //- Construct from dictionary + TrajectoryCollision + ( + const dictionary& dict, + CloudType& cloud + ); + + + //- Destructor + virtual ~TrajectoryCollision(); + + + // Member Functions + + virtual bool active() const; + + virtual bool update + ( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj + ) const; + + // 1 is the larger drop and 2 is the smaller + bool collideSorted + ( + const scalar& dt, + Random& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar& sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar& sigma2, + const label cellj, + const scalar volj + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "TrajectoryCollision.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From c334f75873d5b687a84fe3cfcee0300c10d78e4a Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 23 May 2011 12:24:13 +0100 Subject: [PATCH 11/79] BUG: octree.C : tree building criterion needs to look at any change in tree. --- src/meshTools/octree/octree.C | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/meshTools/octree/octree.C b/src/meshTools/octree/octree.C index 86c2ffc62a..8731f0ef1f 100644 --- a/src/meshTools/octree/octree.C +++ b/src/meshTools/octree/octree.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -149,6 +149,7 @@ Foam::octree::octree // - has some guaranteed maximum size (maxShapeRatio) label oldNLeaves = -1; // make test below pass first time. + label oldNNodes = -1; deepestLevel_ = 1; while ( @@ -169,11 +170,11 @@ Foam::octree::octree break; } - if (oldNLeaves == nLeaves()) + if ((oldNLeaves == nLeaves()) && (oldNNodes == nNodes())) { if (debug & 1) { - Pout<< "octree : exiting since nLeaves does not change" + Pout<< "octree : exiting since nLeaves and nNodes do not change" << endl; } break; @@ -185,6 +186,7 @@ Foam::octree::octree } oldNLeaves = nLeaves(); + oldNNodes = nNodes(); topNode_->redistribute ( From ffffda19efc4f54ce627108abd12d883c80d34bd Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 23 May 2011 12:25:20 +0100 Subject: [PATCH 12/79] ENH: etc/controlDict: added missing entry --- etc/controlDict | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/controlDict b/etc/controlDict index cc45466672..f34834ca55 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -492,6 +492,7 @@ DebugSwitches geomCellLooper 0; geometricSurfacePatch 0; global 0; + globalIndexAndTransform 0; globalMeshData 0; globalPoints 0; gnuplot 0; From 9c7afd1b637995515eba5ef13d09b55874ac51dd Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 23 May 2011 15:32:07 +0100 Subject: [PATCH 13/79] EH: Bringing NN's developments up-to-date with main line --- .../ReactingMultiphaseCloud.H | 1 - .../makeBasicReactingParcelSubmodels.C | 3 - src/lagrangian/spray/Make/files | 2 +- src/lagrangian/spray/Make/options | 41 +- .../clouds/Templates/SprayCloud/SprayCloud.C | 480 ++++++++++-------- .../clouds/Templates/SprayCloud/SprayCloud.H | 169 ++++-- .../clouds/Templates/SprayCloud/SprayCloudI.H | 33 +- .../baseClasses/sprayCloud/sprayCloud.C | 2 +- .../baseClasses/sprayCloud/sprayCloud.H | 2 +- .../basicSprayCloud.H} | 43 +- .../Templates/SprayParcel/SprayParcel.C | 263 +++++----- .../Templates/SprayParcel/SprayParcel.H | 210 ++++---- .../Templates/SprayParcel/SprayParcelI.H | 170 +++---- .../Templates/SprayParcel/SprayParcelIO.C | 126 +++-- .../BasicSprayParcel/BasicSprayParcel.C | 120 ----- .../BasicSprayParcel/BasicSprayParcel.H | 147 ------ .../basicSprayParcel/basicSprayParcel.H | 76 +++ .../defineBasicSprayParcel.C | 9 +- .../makeBasicSprayParcelSubmodels.C | 45 +- .../parcels/include/createSprayParcelTypes.H | 71 --- .../makeSprayParcelAtomizationModels.H | 53 +- .../include/makeSprayParcelBreakupModels.H | 93 +--- .../include/makeSprayParcelCollisionModels.H | 53 +- .../makeSprayParcelCompositionModels.H | 74 --- .../include/makeSprayParcelDispersionModels.H | 98 ---- .../include/makeSprayParcelDragModels.H | 82 --- .../makeSprayParcelHeatTransferModels.H | 82 --- .../include/makeSprayParcelInjectionModels.H | 117 +---- .../makeSprayParcelPatchInteractionModels.H | 92 ---- .../makeSprayParcelPhaseChangeModels.H | 84 --- .../makeSprayParcelPostProcessingModels.H | 84 --- .../AtomizationModel/AtomizationModel.C | 95 +++- .../AtomizationModel/AtomizationModel.H | 101 ++-- .../AtomizationModel/AtomizationModelNew.C} | 0 .../BlobsSheetAtomization.C | 58 ++- .../BlobsSheetAtomization.H | 40 +- .../LISAAtomization/LISAAtomization.C | 186 ++++--- .../LISAAtomization/LISAAtomization.H | 39 +- .../LISAAtomization/LISASMDCalcMethod1.H | 4 +- .../LISAAtomization/LISASMDCalcMethod2.H | 53 ++ .../NoAtomization/NoAtomization.C | 36 +- .../NoAtomization/NoAtomization.H | 37 +- .../BreakupModel/BreakupModel/BreakupModel.C | 101 +++- .../BreakupModel/BreakupModel/BreakupModel.H | 96 ++-- .../BreakupModel/BreakupModelNew.C} | 0 .../{Spray => }/BreakupModel/ETAB/ETAB.C | 83 +-- .../{Spray => }/BreakupModel/ETAB/ETAB.H | 54 +- .../BreakupModel/NoBreakup/NoBreakup.C | 30 +- .../BreakupModel/NoBreakup/NoBreakup.H | 35 +- .../BreakupModel/PilchErdman/PilchErdman.C | 57 +-- .../BreakupModel/PilchErdman/PilchErdman.H | 37 +- .../BreakupModel/ReitzDiwakar/ReitzDiwakar.C | 77 ++- .../BreakupModel/ReitzDiwakar/ReitzDiwakar.H | 37 +- .../BreakupModel/ReitzKHRT/ReitzKHRT.C | 99 ++-- .../BreakupModel/ReitzKHRT/ReitzKHRT.H | 37 +- .../spray/submodels/BreakupModel/SHF/SHF.C | 297 +++++++++++ .../{Spray => }/BreakupModel/SHF/SHF.H | 95 ++-- .../{Spray => }/BreakupModel/TAB/TAB.C | 86 ++-- .../{Spray => }/BreakupModel/TAB/TAB.H | 85 ++-- .../BreakupModel/TAB/TABSMDCalcMethod1.H | 2 +- .../BreakupModel/TAB/TABSMDCalcMethod2.H | 46 ++ .../CollisionModel/CollisionModel.C | 93 +++- .../CollisionModel/CollisionModel.H | 88 ++-- .../CollisionModel/CollisionModelNew.C} | 0 .../CollisionModel/NoCollision/NoCollision.C | 26 +- .../CollisionModel/NoCollision/NoCollision.H | 29 +- .../ORourkeCollision/ORourkeCollision.C | 58 ++- .../ORourkeCollision/ORourkeCollision.H | 37 +- .../TrajectoryCollision/TrajectoryCollision.C | 67 +-- .../TrajectoryCollision/TrajectoryCollision.H | 45 +- .../LISAAtomization/LISASMDCalcMethod2.H | 71 --- .../submodels/Spray/BreakupModel/SHF/SHF.C | 259 ---------- .../BreakupModel/TAB/TABSMDCalcMethod2.H | 54 -- 73 files changed, 2542 insertions(+), 3213 deletions(-) rename src/lagrangian/spray/clouds/derived/{BasicSprayCloud/BasicSprayCloud.H => basicSprayCloud/basicSprayCloud.H} (68%) delete mode 100644 src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.C delete mode 100644 src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.H create mode 100644 src/lagrangian/spray/parcels/derived/basicSprayParcel/basicSprayParcel.H rename src/lagrangian/spray/parcels/derived/{BasicSprayParcel => basicSprayParcel}/defineBasicSprayParcel.C (84%) rename src/lagrangian/spray/parcels/derived/{BasicSprayParcel => basicSprayParcel}/makeBasicSprayParcelSubmodels.C (59%) delete mode 100644 src/lagrangian/spray/parcels/include/createSprayParcelTypes.H delete mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelCompositionModels.H delete mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelDispersionModels.H delete mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelDragModels.H delete mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelHeatTransferModels.H delete mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelPatchInteractionModels.H delete mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelPhaseChangeModels.H delete mode 100644 src/lagrangian/spray/parcels/include/makeSprayParcelPostProcessingModels.H rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/AtomizationModel/AtomizationModel.C (58%) rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/AtomizationModel/AtomizationModel.H (72%) rename src/lagrangian/spray/submodels/{Spray/AtomizationModel/AtomizationModel/NewAtomizationModel.C => AtomizationModel/AtomizationModel/AtomizationModelNew.C} (100%) rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C (74%) rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H (80%) rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/LISAAtomization/LISAAtomization.C (59%) rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/LISAAtomization/LISAAtomization.H (83%) rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H (84%) create mode 100644 src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/NoAtomization/NoAtomization.C (84%) rename src/lagrangian/spray/submodels/{Spray => }/AtomizationModel/NoAtomization/NoAtomization.H (77%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/BreakupModel/BreakupModel.C (57%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/BreakupModel/BreakupModel.H (75%) rename src/lagrangian/spray/submodels/{Spray/BreakupModel/BreakupModel/NewBreakupModel.C => BreakupModel/BreakupModel/BreakupModelNew.C} (100%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/ETAB/ETAB.C (71%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/ETAB/ETAB.H (77%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/NoBreakup/NoBreakup.C (83%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/NoBreakup/NoBreakup.H (80%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/PilchErdman/PilchErdman.C (77%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/PilchErdman/PilchErdman.H (81%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/ReitzDiwakar/ReitzDiwakar.C (65%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/ReitzDiwakar/ReitzDiwakar.H (83%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/ReitzKHRT/ReitzKHRT.C (71%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/ReitzKHRT/ReitzKHRT.H (81%) create mode 100644 src/lagrangian/spray/submodels/BreakupModel/SHF/SHF.C rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/SHF/SHF.H (67%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/TAB/TAB.C (76%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/TAB/TAB.H (68%) rename src/lagrangian/spray/submodels/{Spray => }/BreakupModel/TAB/TABSMDCalcMethod1.H (79%) create mode 100644 src/lagrangian/spray/submodels/BreakupModel/TAB/TABSMDCalcMethod2.H rename src/lagrangian/spray/submodels/{Spray => }/CollisionModel/CollisionModel/CollisionModel.C (56%) rename src/lagrangian/spray/submodels/{Spray => }/CollisionModel/CollisionModel/CollisionModel.H (76%) rename src/lagrangian/spray/submodels/{Spray/CollisionModel/CollisionModel/NewCollisionModel.C => CollisionModel/CollisionModel/CollisionModelNew.C} (100%) rename src/lagrangian/spray/submodels/{Spray => }/CollisionModel/NoCollision/NoCollision.C (89%) rename src/lagrangian/spray/submodels/{Spray => }/CollisionModel/NoCollision/NoCollision.H (84%) rename src/lagrangian/spray/submodels/{Spray => }/CollisionModel/ORourkeCollision/ORourkeCollision.C (88%) rename src/lagrangian/spray/submodels/{Spray => }/CollisionModel/ORourkeCollision/ORourkeCollision.H (84%) rename src/lagrangian/spray/submodels/{Spray => }/CollisionModel/TrajectoryCollision/TrajectoryCollision.C (89%) rename src/lagrangian/spray/submodels/{Spray => }/CollisionModel/TrajectoryCollision/TrajectoryCollision.H (83%) delete mode 100644 src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H delete mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.C delete mode 100644 src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod2.H diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H index 1f7d3dd22e..59e0cc0707 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H @@ -41,7 +41,6 @@ SourceFiles #ifndef ReactingMultiphaseCloud_H #define ReactingMultiphaseCloud_H -#include "ReactingCloud.H" #include "reactingMultiphaseCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C index acda24158c..157a1ab3f7 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C @@ -45,9 +45,6 @@ License namespace Foam { - typedef basicReactingCloud::thermoCloudType thermoCloudType2; - typedef basicReactingCloud::kinematicCloudType kinematicCloudType2; - makeParcelCloudFunctionObjects(basicReactingCloud); // Kinematic sub-models diff --git a/src/lagrangian/spray/Make/files b/src/lagrangian/spray/Make/files index 50487e18a8..7446d9a7a3 100644 --- a/src/lagrangian/spray/Make/files +++ b/src/lagrangian/spray/Make/files @@ -1,6 +1,6 @@ clouds/baseClasses/sprayCloud/sprayCloud.C -SPRAYPARCEL=parcels/derived/BasicSprayParcel +SPRAYPARCEL=parcels/derived/basicSprayParcel $(SPRAYPARCEL)/defineBasicSprayParcel.C $(SPRAYPARCEL)/makeBasicSprayParcelSubmodels.C diff --git a/src/lagrangian/spray/Make/options b/src/lagrangian/spray/Make/options index 9740405e80..0d8cf66e84 100644 --- a/src/lagrangian/spray/Make/options +++ b/src/lagrangian/spray/Make/options @@ -1,25 +1,46 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ + -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude + -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude LIB_LIBS = \ -lfiniteVolume \ -lmeshTools \ + -ldistributionModels \ -llagrangian \ - -llagrangianIntermediate + -llagrangianIntermediate \ + -lliquidProperties \ + -lliquidMixtureProperties \ + -lsolidProperties \ + -lsolidMixtureProperties \ + -lspecie \ + -lbasicThermophysicalModels \ + -lreactionThermophysicalModels \ + -lSLGThermo \ + -lchemistryModel \ + -lradiationModels \ + -lODE \ + -lcompressibleRASModels \ + -lcompressibleLESModels \ + -ldynamicFvMesh \ + -lsurfaceFilmModels diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C index 760b52a0e3..af32eaebad 100644 --- a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C +++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,96 +27,254 @@ License #include "AtomizationModel.H" #include "BreakupModel.H" #include "CollisionModel.H" -#include "PtrList.H" -template -void Foam::SprayCloud::preEvolve() +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +template +void Foam::SprayCloud::setModels() { - ReactingCloud::preEvolve(); + atomizationModel_.reset + ( + AtomizationModel >::New + ( + this->subModelProperties(), + *this + ).ptr() + ); + + breakupModel_.reset + ( + BreakupModel >::New + ( + this->subModelProperties(), + *this + ).ptr() + ); + + collisionModel_.reset + ( + CollisionModel >::New + ( + this->subModelProperties(), + *this + ).ptr() + ); } -template -void Foam::SprayCloud::evolveCloud() +template +void Foam::SprayCloud::cloudReset +( + SprayCloud& c +) { - const volScalarField& T = this->carrierThermo().T(); - const volScalarField cp = this->carrierThermo().Cp(); - const volScalarField& p = this->carrierThermo().p(); + CloudType::cloudReset(c); - autoPtr > rhoInterp = interpolation::New + atomizationModel_.reset(c.atomizationModel_.ptr()); + breakupModel_.reset(c.breakupModel_.ptr()); + collisionModel_.reset(c.collisionModel_.ptr()); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::SprayCloud::SprayCloud +( + const word& cloudName, + const volScalarField& rho, + const volVectorField& U, + const dimensionedVector& g, + const SLGThermo& thermo, + bool readFields +) +: + CloudType(cloudName, rho, U, g, thermo, false), + sprayCloud(), + cloudCopyPtr_(NULL), + averageParcelMass_(this->injection().averageParcelMass()), + atomizationModel_ ( - this->interpolationSchemes(), - this->rho() - ); - - autoPtr > UInterp = interpolation::New + AtomizationModel >::New + ( + this->particleProperties(), + *this + ) + ), + breakupModel_ ( - this->interpolationSchemes(), - this->U() - ); - - autoPtr > muInterp = interpolation::New + BreakupModel >::New + ( + this->particleProperties(), + *this + ) + ), + collisionModel_ ( - this->interpolationSchemes(), - this->mu() - ); + CollisionModel >::New + ( + this->particleProperties(), + *this + ) + ) +{ + if (this->solution().active()) + { + setModels(); - autoPtr > TInterp = interpolation::New - ( - this->interpolationSchemes(), - T - ); + if (readFields) + { + parcelType::readFields(*this, this->composition()); + } + } - autoPtr > cpInterp = interpolation::New - ( - this->interpolationSchemes(), - cp - ); - - autoPtr > pInterp = interpolation::New - ( - this->interpolationSchemes(), - p - ); - - typename ParcelType::trackData td - ( - *this, - constProps_, - rhoInterp(), - UInterp(), - muInterp(), - TInterp(), - cpInterp(), - pInterp(), - this->g().value() - ); - - if (this->coupled()) + if (this->solution().resetSourcesOnStartup()) { resetSourceTerms(); } + Info << " Average parcel mass: " << averageParcelMass_ << endl; +} + + +template +Foam::SprayCloud::SprayCloud +( + SprayCloud& c, + const word& name +) +: + CloudType(c, name), + sprayCloud(), + cloudCopyPtr_(NULL), + averageParcelMass_(c.averageParcelMass_), + atomizationModel_(c.atomizationModel_->clone()), + breakupModel_(c.breakupModel_->clone()), + collisionModel_(c.collisionModel_->clone()) +{} + + +template +Foam::SprayCloud::SprayCloud +( + const fvMesh& mesh, + const word& name, + const SprayCloud& c +) +: + CloudType(mesh, name, c), + sprayCloud(), + cloudCopyPtr_(NULL), + averageParcelMass_(0.0), + atomizationModel_(NULL), + breakupModel_(NULL), + collisionModel_(NULL) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::SprayCloud::~SprayCloud() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::SprayCloud::checkParcelProperties +( + parcelType& parcel, + const scalar lagrangianDt, + const bool fullyDescribed +) +{ + CloudType::checkParcelProperties + ( + parcel, + lagrangianDt, + fullyDescribed + ); + + const scalarField& Y(parcel.Y()); + scalarField X(this->composition().liquids().X(Y)); + + // override rho and cp from constantProperties + parcel.Cp() = this->composition().liquids().Cp(parcel.pc(), parcel.T(), X); + parcel.rho() = this->composition().liquids().rho(parcel.pc(), parcel.T(), X); + + // store the injection position and initial drop size + parcel.position0() = parcel.position(); + parcel.d0() = parcel.d(); + + parcel.y() = breakup().y0(); + parcel.yDot() = breakup().yDot0(); +} + + +template +void Foam::SprayCloud::storeState() +{ + cloudCopyPtr_.reset + ( + static_cast*> + ( + clone(this->name() + "Copy").ptr() + ) + ); +} + + +template +void Foam::SprayCloud::restoreState() +{ + cloudReset(cloudCopyPtr_()); + cloudCopyPtr_.clear(); +} + + +template +void Foam::SprayCloud::evolve() +{ + if (this->solution().canEvolve()) + { + typename parcelType::template + TrackingData > td(*this); + + this->solve(td); + } +} + + +template +template +void Foam::SprayCloud::motion(TrackData& td) +{ + const scalar dt = this->solution().trackTime(); + + td.part() = TrackData::tpLinearTrack; + CloudType::move(td, dt); + + this->updateCellOccupancy(); + + if (collision().active()) { - label i = 0; - scalar dt = this->db().time().deltaTValue(); - forAllIter(typename Cloud, *this, iter) + forAllIter(typename SprayCloud, *this, iter) { - label j = 0; - forAllIter(typename Cloud, *this, jter) + forAllIter(typename SprayCloud, *this, jter) { if (j > i) { - ParcelType& p = iter(); + parcelType& p = iter(); scalar Vi = this->mesh().V()[p.cell()]; scalarField X1(this->composition().liquids().X(p.Y())); scalar sigma1 = this->composition().liquids().sigma(p.pc(), p.T(), X1); scalar mp = p.mass()*p.nParticle(); - ParcelType& q = jter(); + parcelType& q = jter(); scalar Vj = this->mesh().V()[q.cell()]; scalarField X2(this->composition().liquids().X(q.Y())); scalar sigma2 = this->composition().liquids().sigma(q.pc(), q.T(), X2); @@ -158,8 +316,8 @@ void Foam::SprayCloud::evolveCloud() { scalarField Xp(this->composition().liquids().X(p.Y())); p.rho() = this->composition().liquids().rho(p.pc(), p.T(), Xp); - p.cp() = this->composition().liquids().cp(p.pc(), p.T(), Xp); - scalar rhs = 6.0*mp/(p.nParticle()*p.rho()*mathematicalConstant::pi); + p.Cp() = this->composition().liquids().Cp(p.pc(), p.T(), Xp); + scalar rhs = 6.0*mp/(p.nParticle()*p.rho()*constant::mathematical::pi); p.d() = pow(rhs, 1.0/3.0); } @@ -167,140 +325,42 @@ void Foam::SprayCloud::evolveCloud() { scalarField Xq(this->composition().liquids().X(q.Y())); q.rho() = this->composition().liquids().rho(q.pc(), q.T(), Xq); - q.cp() = this->composition().liquids().cp(q.pc(), q.T(), Xq); - scalar rhs = 6.0*mq/(q.nParticle()*q.rho()*mathematicalConstant::pi); + q.Cp() = this->composition().liquids().Cp(q.pc(), q.T(), Xq); + scalar rhs = 6.0*mq/(q.nParticle()*q.rho()*constant::mathematical::pi); q.d() = pow(rhs, 1.0/3.0); } - } } j++; } - i++; } // remove coalesced particles (diameter set to 0) - forAllIter(typename Cloud, *this, iter) + forAllIter(typename SprayCloud, *this, iter) { - ParcelType& p = iter(); + parcelType& p = iter(); if (p.mass() < VSMALL) { deleteParticle(p); } } } - - Cloud::move(td); - this->injection().inject(td); } -template -void Foam::SprayCloud::postEvolve() -{ - ReactingCloud::postEvolve(); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::SprayCloud::SprayCloud +template +Foam::scalar Foam::SprayCloud::D ( - const word& cloudName, - const volScalarField& rho, - const volVectorField& U, - const dimensionedVector& g, - basicThermo& thermo, - bool readFields -) -: - ReactingCloud(cloudName, rho, U, g, thermo, false), - sprayCloud(), - averageParcelMass_(this->injection().averageParcelMass()), - constProps_(this->particleProperties()), - atomizationModel_ - ( - AtomizationModel >::New - ( - this->particleProperties(), - *this - ) - ), - breakupModel_ - ( - BreakupModel >::New - ( - this->particleProperties(), - *this - ) - ), - collisionModel_ - ( - CollisionModel >::New - ( - this->particleProperties(), - *this - ) - ) -{ - if (readFields) - { - ParcelType::readFields(*this); - } - - Info << " Average parcel mass: " << averageParcelMass_ << endl; -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::SprayCloud::~SprayCloud() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -void Foam::SprayCloud::checkParcelProperties -( - ParcelType& parcel, - const scalar lagrangianDt, - const bool fullyDescribed -) -{ - ReactingCloud::checkParcelProperties - ( - parcel, - lagrangianDt, - fullyDescribed - ); - - const scalarField& Y(parcel.Y()); - scalarField X(this->composition().liquids().X(Y)); - - // override rho and cp from constantProperties - parcel.cp() = this->composition().liquids().cp(parcel.pc(), parcel.T(), X); - parcel.rho() = this->composition().liquids().rho(parcel.pc(), parcel.T(), X); - - // store the injection position and initial drop size - parcel.position0() = parcel.position(); - parcel.d0() = parcel.d(); - - parcel.y() = breakup().y0(); - parcel.yDot() = breakup().yDot0(); -} - -template -Foam::scalar Foam::SprayCloud::D(const label i, const label j) const + const label i, + const label j +) const { scalar si = 0.0; scalar sj = 0.0; - forAllConstIter(typename Cloud, *this, iter) + forAllConstIter(typename SprayCloud, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); si += p.nParticle()*pow(p.d(), i); sj += p.nParticle()*pow(p.d(), j); } @@ -313,30 +373,32 @@ Foam::scalar Foam::SprayCloud::D(const label i, const label j) const } -template -Foam::scalar Foam::SprayCloud::liquidPenetration(const scalar& prc) const +template +Foam::scalar Foam::SprayCloud::liquidPenetration +( + const scalar& prc +) const { - scalar distance = 0.0; scalar mTot = 0.0; - label Np = this->size(); + label np = this->size(); // arrays containing the parcels mass and // distance from injector in ascending order - scalarField mass(Np); - scalarField dist(Np); + scalarField mass(np); + scalarField dist(np); - if (Np > 0) + if (np > 0) { label n = 0; // first arrange the parcels in ascending order // the first parcel is closest to its injection position // and the last one is most far away. - forAllConstIter(typename Cloud, *this, iter) + forAllConstIter(typename SprayCloud, *this, iter) { - const ParcelType& p = iter(); + const parcelType& p = iter(); scalar mi = p.nParticle()*p.mass(); scalar di = mag(p.position() - p.position0()); mTot += mi; @@ -350,12 +412,12 @@ Foam::scalar Foam::SprayCloud::liquidPenetration(const scalar& prc) // insert the parcel in the correct place // and move the others - while ( ( i < n ) && ( !found ) ) + while (( i < n ) && (!found)) { if (di < dist[i]) { found = true; - for(label j=n; j>i; j--) + for (label j=n; j>i; j--) { mass[j] = mass[j-1]; dist[j] = dist[j-1]; @@ -371,32 +433,33 @@ Foam::scalar Foam::SprayCloud::liquidPenetration(const scalar& prc) reduce(mTot, sumOp()); - if (Np > 0) + if (np > 0) { - scalar mLimit = prc*mTot; scalar mOff = (1.0 - prc)*mTot; - if (Np > 1) + if (np > 1) { - // 'prc' is large enough that the parcel most far // away will be used, no need to loop... - if (mLimit > mTot - mass[Np-1]) + if (mLimit > mTot - mass[np-1]) { - distance = dist[Np-1]; + distance = dist[np-1]; } else { scalar mOffSum = 0.0; - label i = Np; + label i = np; while ((mOffSum < mOff) && (i>0)) { i--; mOffSum += mass[i]; } - distance = dist[i+1] + (dist[i]-dist[i+1])*(mOffSum - mOff)/mass[i+1] ; + distance = + dist[i+1] + + (dist[i] - dist[i+1])*(mOffSum - mOff) + /mass[i+1] ; } } else @@ -410,35 +473,12 @@ Foam::scalar Foam::SprayCloud::liquidPenetration(const scalar& prc) return distance; } -template -void Foam::SprayCloud::resetSourceTerms() + +template +void Foam::SprayCloud::info() const { - ReactingCloud::resetSourceTerms(); -} - - -template -void Foam::SprayCloud::evolve() -{ - if (this->active()) - { - preEvolve(); - - evolveCloud(); - - postEvolve(); - - info(); - Info<< endl; - } -} - - -template -void Foam::SprayCloud::info() const -{ - ReactingCloud::info(); - scalar d32 = 1.0e+6*D(3,2); + CloudType::info(); + scalar d32 = 1.0e+6*D(3, 2); scalar pen = liquidPenetration(0.95); Info << " D32 (mu) = " << d32 << endl; diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H index bb27f1d8e2..09d555a452 100644 --- a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H +++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,15 +25,14 @@ Class Foam::SprayCloud Description + Templated base class for spray cloud \*---------------------------------------------------------------------------*/ #ifndef SprayCloud_H #define SprayCloud_H -#include "ReactingCloud.H" #include "sprayCloud.H" -#include "thermoPhysicsTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,26 +53,37 @@ class CollisionModel; Class SprayCloud Declaration \*---------------------------------------------------------------------------*/ - -template +template class SprayCloud : - public ReactingCloud, + public CloudType, public sprayCloud { -private: - - //- Average parcel mass - scalar averageParcelMass_; - public: - //- Type of thermodynamics the cloud was instantiated for - typedef typename ParcelType::thermoType thermoType; + // Public typedefs + + //- Type of cloud this cloud was instantiated for + typedef CloudType cloudType; + + //- Type of parcel the cloud was instantiated for + typedef typename CloudType::particleType parcelType; + + //- Convenience typedef for this cloud type + typedef SprayCloud sprayCloudType; private: + // Private data + + //- Cloud copy pointer + autoPtr > cloudCopyPtr_; + + //- Average parcel mass + scalar averageParcelMass_; + + // Private Member Functions //- Disallow default bitwise copy construct @@ -85,26 +95,33 @@ private: protected: - //- Parcel constant properties - typename ParcelType::constantProperties constProps_; + // Protected data - // Reference to the cloud sub-models - autoPtr > > atomizationModel_; + // References to the cloud sub-models - autoPtr > > breakupModel_; + //- Atomization model + autoPtr > > + atomizationModel_; + + //- Break-up model + autoPtr > > breakupModel_; + + //- Collision model + autoPtr > > collisionModel_; + + + // Protected Member Functions + + // Initialisation + + //- Set cloud sub-models + void setModels(); - autoPtr > > collisionModel_; // Cloud evolution functions - //- Pre-evolve - void preEvolve(); - - //- Evolve the cloud - void evolveCloud(); - - //- Post-evolve - void postEvolve(); + //- Reset state of cloud + void cloudReset(SprayCloud& c); public: @@ -118,68 +135,108 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - basicThermo& thermo, + const SLGThermo& thermo, bool readFields = true ); + //- Copy constructor with new name + SprayCloud(SprayCloud& c, const word& name); + + //- Copy constructor with new name - creates bare cloud + SprayCloud + ( + const fvMesh& mesh, + const word& name, + const SprayCloud& c + ); + + + //- Construct and return clone based on (this) with new name + virtual autoPtr > clone(const word& name) + { + return autoPtr > + ( + new SprayCloud(*this, name) + ); + } + + //- Construct and return bare clone based on (this) with new name + virtual autoPtr > cloneBare(const word& name) const + { + return autoPtr > + ( + new SprayCloud(this->mesh(), name, *this) + ); + } + //- Destructor virtual ~SprayCloud(); - //- Type of parcel the cloud was instantiated for - typedef ParcelType parcelType; - // Member Functions // Access - //- Return the constant properties - inline const typename ParcelType::constantProperties& - constProps() const; + //- Return a reference to the cloud copy + inline const SprayCloud& cloudCopy() const; + + //- Return const-access to the average parcel mass + inline scalar averageParcelMass() const; + + + // Sub-models + + //- Return const-access to the atomization model + inline const AtomizationModel >& + atomization() const; + + //- Return const-access to the breakup model + inline const BreakupModel >& + breakup() const; + + //- Return const-access to the breakup model + inline const CollisionModel >& + collision() const; + // Check + //- Calculate the liquid penetration for prc % of the mass + scalar liquidPenetration(const scalar& prc) const; + + //- Calculate the diameter Dij + scalar D(const label i, const label j) const; + //- Print cloud information void info() const; + // Cloud evolution functions //- Check parcel properties void checkParcelProperties ( - ParcelType& parcel, + parcelType& parcel, const scalar lagrangianDt, const bool fullyDescribed ); + //- Store the current cloud state + void storeState(); + + //- Reset the current cloud to the previously stored state + void restoreState(); + //- Reset the spray source terms void resetSourceTerms(); //- Evolve the spray (inject, move) void evolve(); + //- Particle motion - //- Return const-access to the atomization model - inline const AtomizationModel >& - atomization() const; - - //- Return const-access to the breakup model - inline const BreakupModel >& - breakup() const; - - //- Return const-access to the breakup model - inline const CollisionModel >& - collision() const; - - //- Return const-access to the average parcel mass - inline const scalar& averageParcelMass() const; - - //- Calculate the diameter Dij - scalar D(const label i, const label j) const; - - //- Calculate the liquid penetration for prc % of the mass - scalar liquidPenetration(const scalar& prc) const; - + template + void motion(TrackData& td); }; diff --git a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H index 08f97293f0..57edee7077 100644 --- a/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H +++ b/src/lagrangian/spray/clouds/Templates/SprayCloud/SprayCloudI.H @@ -25,35 +25,40 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -inline const typename ParcelType::constantProperties& -Foam::SprayCloud::constProps() const +template +inline const Foam::SprayCloud& +Foam::SprayCloud::cloudCopy() const { - return constProps_; + return cloudCopyPtr_(); } -template -inline const Foam::AtomizationModel >& Foam::SprayCloud::atomization() const + +template +inline const Foam::AtomizationModel >& +Foam::SprayCloud::atomization() const { return atomizationModel_; } -template -inline const Foam::BreakupModel >& -Foam::SprayCloud::breakup() const + +template +inline const Foam::BreakupModel >& +Foam::SprayCloud::breakup() const { return breakupModel_; } -template -inline const Foam::CollisionModel >& -Foam::SprayCloud::collision() const + +template +inline const Foam::CollisionModel >& +Foam::SprayCloud::collision() const { return collisionModel_; } -template -inline const Foam::scalar& Foam::SprayCloud::averageParcelMass() const + +template +inline Foam::scalar Foam::SprayCloud::averageParcelMass() const { return averageParcelMass_; } diff --git a/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.C b/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.C index 522afeffc1..4e0f125263 100644 --- a/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.C +++ b/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.H b/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.H index afbae6cd90..f4540a547f 100644 --- a/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.H +++ b/src/lagrangian/spray/clouds/baseClasses/sprayCloud/sprayCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/lagrangian/spray/clouds/derived/BasicSprayCloud/BasicSprayCloud.H b/src/lagrangian/spray/clouds/derived/basicSprayCloud/basicSprayCloud.H similarity index 68% rename from src/lagrangian/spray/clouds/derived/BasicSprayCloud/BasicSprayCloud.H rename to src/lagrangian/spray/clouds/derived/basicSprayCloud/basicSprayCloud.H index 2c57a37aa1..736ebfd88f 100644 --- a/src/lagrangian/spray/clouds/derived/BasicSprayCloud/BasicSprayCloud.H +++ b/src/lagrangian/spray/clouds/derived/basicSprayCloud/basicSprayCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,34 +22,43 @@ License along with OpenFOAM. If not, see . Class - Foam::BasicSprayCloud + Foam::basicSprayCloud Description + Cloud class to introduce reacting spray parcels \*---------------------------------------------------------------------------*/ -#ifndef BasicSprayCloud_H -#define BasicSprayCloud_H +#ifndef basicSprayCloud_H +#define basicSprayCloud_H -#include "BasicSprayParcel.H" +#include "Cloud.H" +#include "KinematicCloud.H" +#include "ThermoCloud.H" +#include "ReactingCloud.H" #include "SprayCloud.H" -#include "SprayParcel.H" -#include "thermoPhysicsTypes.H" +#include "basicSprayParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - - typedef SprayCloud > - thermoSprayCloud; - - typedef SprayCloud > - constThermoSprayCloud; - - typedef SprayCloud > - icoPoly8ThermoSprayCloud; - + typedef SprayCloud + < + ReactingCloud + < + ThermoCloud + < + KinematicCloud + < + Cloud + < + basicSprayParcel + > + > + > + > + > basicSprayCloud; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C index 4ab5ac3b5e..a301cfab5c 100644 --- a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,36 +24,10 @@ License \*---------------------------------------------------------------------------*/ #include "SprayParcel.H" +#include "CompositionModel.H" +#include "AtomizationModel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::SprayParcel::SprayParcel -( - const SprayParcel& p -) -: - ReactingParcel(p), - d0_(p.d0_), - position0_(p.position0_), - liquidCore_(p.liquidCore_), - KHindex_(p.KHindex_), - y_(p.y_), - yDot_(p.yDot_), - tc_(p.tc_), - ms_(p.ms_), - injector_(p.injector_), - tMom_(p.tMom_), - user_(p.user_) -{} - - -// * * * * * * * * * * * Member Functions * * * * * * * * * * * * // - -// NN. Dont think all these functions are needed, but I'm adding them in case -// one might have to add anything later - +// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // template template @@ -64,7 +38,7 @@ void Foam::SprayParcel::setCellValues const label cellI ) { - ReactingParcel::setCellValues(td, dt, cellI); + ParcelType::setCellValues(td, dt, cellI); } @@ -77,37 +51,10 @@ void Foam::SprayParcel::cellValueSourceCorrection const label cellI ) { - ReactingParcel::cellValueSourceCorrection(td, dt, cellI); + ParcelType::cellValueSourceCorrection(td, dt, cellI); } -template -template -void Foam::SprayParcel::correctSurfaceValues -( - TrackData& td, - const label cellI, - const scalar T, - const scalarField& Cs, - scalar& rhos, - scalar& mus, - scalar& Pr, - scalar& kappa -) -{ - ReactingParcel::correctSurfaceValues - ( - td, - cellI, - T, - Cs, - rhos, - mus, - Pr, - kappa - ); -} - template template void Foam::SprayParcel::calc @@ -117,16 +64,15 @@ void Foam::SprayParcel::calc const label cellI ) { - - bool coupled = td.cloud().coupled(); + bool coupled = td.cloud().solution().coupled(); // check if parcel belongs to liquid core if (liquidCore() > 0.5) { // liquid core parcels should not interact with the gas - if (td.cloud().coupled()) + if (td.cloud().solution().coupled()) { - td.cloud().coupled() = false; + td.cloud().solution().coupled() = false; } } @@ -135,21 +81,21 @@ void Foam::SprayParcel::calc scalarField X(td.cloud().composition().liquids().X(Y)); scalar T0 = this->T(); - this->cp() = td.cloud().composition().liquids().cp(this->pc_, T0, X); + this->Cp() = td.cloud().composition().liquids().Cp(this->pc_, T0, X); scalar rho0 = td.cloud().composition().liquids().rho(this->pc_, T0, X); this->rho() = rho0; - ReactingParcel::calc(td, dt, cellI); + ParcelType::calc(td, dt, cellI); if (td.keepParticle) { - - // update drop cp, diameter and density because of change in temperature/composition + // update Cp, diameter and density due to change in temperature + // and/or composition scalar T1 = this->T(); const scalarField& Y1(this->Y()); scalarField X1(td.cloud().composition().liquids().X(Y1)); - this->cp() = td.cloud().composition().liquids().cp(this->pc_, T1, X1); + this->Cp() = td.cloud().composition().liquids().Cp(this->pc_, T1, X1); scalar rho1 = td.cloud().composition().liquids().rho(this->pc_, T1, X1); this->rho() = rho1; @@ -160,9 +106,10 @@ void Foam::SprayParcel::calc { calcAtomization(td, dt, cellI); - // preserve the total mass/volume, by increasing the number of particles in parcels due to breakup + // preserve the total mass/volume by increasing the number of + // particles in parcels due to breakup scalar d2 = this->d(); - this->nParticle() *= pow(d1/d2, 3.0); + this->nParticle() *= pow3(d1/d2); } else { @@ -171,7 +118,7 @@ void Foam::SprayParcel::calc } // restore coupled - td.cloud().coupled() = coupled; + td.cloud().solution().coupled() = coupled; } @@ -184,25 +131,33 @@ void Foam::SprayParcel::calcAtomization const label cellI ) { + typedef typename TrackData::cloudType::reactingCloudType reactingCloudType; + const CompositionModel& composition = + td.cloud().composition(); + + typedef typename TrackData::cloudType::sprayCloudType sprayCloudType; + const AtomizationModel& atomization = + td.cloud().atomization(); + // cell state info is updated in ReactingParcel calc const scalarField& Y(this->Y()); - scalarField X(td.cloud().composition().liquids().X(Y)); + scalarField X(composition.liquids().X(Y)); - scalar rho = td.cloud().composition().liquids().rho(this->pc_, this->T(), X); - scalar mu = td.cloud().composition().liquids().mu(this->pc_, this->T(), X); - scalar sigma = td.cloud().composition().liquids().sigma(this->pc_, this->T(), X); + scalar rho = composition.liquids().rho(this->pc(), this->T(), X); + scalar mu = composition.liquids().mu(this->pc(), this->T(), X); + scalar sigma = composition.liquids().sigma(this->pc(), this->T(), X); // Average molecular weight of carrier mix - assumes perfect gas - scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; + scalar Wc = this->rhoc_*specie::RR*this->Tc()/this->pc(); scalar R = specie::RR/Wc; - scalar Tav = td.cloud().atomization().Taverage(this->T(), this->Tc_); + scalar Tav = atomization.Taverage(this->T(), this->Tc()); // calculate average gas density based on average temperature - scalar rhoAv = this->pc_/(R*Tav); + scalar rhoAv = this->pc()/(R*Tav); scalar soi = td.cloud().injection().timeStart(); - scalar currentTime = this->cloud().db().time().value(); + scalar currentTime = td.cloud().db().time().value(); const vector& pos = this->position(); const vector& injectionPos = this->position0(); @@ -210,19 +165,18 @@ void Foam::SprayParcel::calcAtomization // (in line with the deactivated coupled assumption) scalar Urel = mag(this->U()); - scalar traveledTime = mag(pos - injectionPos)/Urel; - scalar t0 = max(0.0, currentTime - traveledTime - soi); + scalar t0 = max(0.0, currentTime - this->age() - soi); scalar t1 = min(t0 + dt, td.cloud().injection().timeEnd() - soi); - // this should be the massflow from when the parcel was injected - scalar massflowRate = rho*td.cloud().injection().volumeToInject(t0, t1)/dt; + // this should be the vol flow rate from when the parcel was injected + scalar volFlowRate = td.cloud().injection().volumeToInject(t0, t1)/dt; scalar chi = 0.0; - if (td.cloud().atomization().calcChi()) + if (atomization.calcChi()) { - chi = this->chi(td, X); + chi = this->chi(td, X); } - td.cloud().atomization().update + atomization.update ( dt, this->d(), @@ -231,7 +185,7 @@ void Foam::SprayParcel::calcAtomization rho, mu, sigma, - massflowRate, + volFlowRate, rhoAv, Urel, pos, @@ -240,7 +194,6 @@ void Foam::SprayParcel::calcAtomization chi, td.cloud().rndGen() ); - } @@ -253,6 +206,9 @@ void Foam::SprayParcel::calcBreakup const label cellI ) { + typedef typename TrackData::cloudType::reactingCloudType reactingCloudType; + const CompositionModel& composition = + td.cloud().composition(); if (td.cloud().breakup().solveOscillationEq()) { @@ -261,21 +217,21 @@ void Foam::SprayParcel::calcBreakup // cell state info is updated in ReactingParcel calc const scalarField& Y(this->Y()); - scalarField X(td.cloud().composition().liquids().X(Y)); + scalarField X(composition.liquids().X(Y)); - scalar rho = td.cloud().composition().liquids().rho(this->pc_, this->T(), X); - scalar mu = td.cloud().composition().liquids().mu(this->pc_, this->T(), X); - scalar sigma = td.cloud().composition().liquids().sigma(this->pc_, this->T(), X); + scalar rho = composition.liquids().rho(this->pc(), this->T(), X); + scalar mu = composition.liquids().mu(this->pc(), this->T(), X); + scalar sigma = composition.liquids().sigma(this->pc(), this->T(), X); // Average molecular weight of carrier mix - assumes perfect gas - scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; + scalar Wc = this->rhoc()*specie::RR*this->Tc()/this->pc(); scalar R = specie::RR/Wc; - scalar Tav = td.cloud().atomization().Taverage(this->T(), this->Tc_); + scalar Tav = td.cloud().atomization().Taverage(this->T(), this->Tc()); // calculate average gas density based on average temperature - scalar rhoAv = this->pc_/(R*Tav); - scalar muAv = this->muc_; - vector Urel = this->U() - this->Uc_; + scalar rhoAv = this->pc()/(R*Tav); + scalar muAv = this->muc(); + vector Urel = this->U() - this->Uc(); scalar Urmag = mag(Urel); scalar As = this->areaS(this->d()); scalar Re = rhoAv*Urmag*this->d()/muAv; @@ -317,24 +273,17 @@ void Foam::SprayParcel::calcBreakup ) ) { - scalar As = this->areaS(dChild); scalar Re = rhoAv*Urmag*dChild/muAv; scalar utc = td.cloud().drag().utc(Re, dChild, muAv) + ROOTVSMALL; this->mass0() -= massChild; - // add child parcel. most properties will be identical to the parent - ParcelType* child = new ParcelType(td.cloud(), this->position(), cellI); - scalar massDrop = rho*mathematicalConstant::pi*pow(dChild, 3.0)/6.0; + // Add child parcel as copy of parent + SprayParcel* child = new SprayParcel(*this); + scalar massDrop = rho*constant::mathematical::pi*pow(dChild, 3.0)/6.0; child->mass0() = massChild; child->d() = dChild; - child->rho() = this->rho(); - child->T() = this->T(); - child->cp() = this->cp(); - child->U() = this->U(); child->nParticle() = massChild/massDrop; - child->d0() = this->d0(); - child->position0() = this->position0(); child->liquidCore() = 0.0; child->KHindex() = 1.0; child->y() = td.cloud().breakup().y0(); @@ -343,7 +292,6 @@ void Foam::SprayParcel::calcBreakup child->ms() = 0.0; child->injector() = this->injector(); child->tMom() = 1.0/(As*utc); - child->Y() = this->Y(); child->user() = 0.0; child->setCellValues(td, dt, cellI); @@ -360,37 +308,38 @@ Foam::scalar Foam::SprayParcel::chi const scalarField& X ) const { + // modifications to take account of the flash boiling on primary break-up + static label nIter = 200; -// modifications to take account of the flash boiling on primary breakUp + typedef typename TrackData::cloudType::reactingCloudType reactingCloudType; + const CompositionModel& composition = + td.cloud().composition(); scalar chi = 0.0; - label Nf = td.cloud().composition().liquids().components().size(); - - scalar Td = this->T(); + scalar T0 = this->T(); + scalar Tc0 = this->Tc(); + scalar p0 = this->pc(); scalar pAmb = td.cloud().pAmbient(); - for(label i = 0; i < Nf ; i++) + scalar pv = composition.liquids().sigma(p0, T0, X); + + forAll(composition.liquids(), i) { - scalar pv = td.cloud().composition().liquids().sigma(this->pc_, this->T(), X); - - if(pv >= 0.999*pAmb) + if (pv >= 0.999*pAmb) { + // liquid is boiling - calc boiling temperature -// The fuel is boiling..... -// Calculation of the boiling temperature + const liquidProperties& liq = composition.liquids().properties()[i]; + scalar TBoil = T0; - scalar tBoilingSurface = Td; - - label Niter = 200; - - for(label k=0; k< Niter ; k++) + for (label k=0; kpc_, tBoilingSurface); + scalar pBoil = liq.pv(p0, TBoil); - if(pBoil > this->pc_) + if (pBoil > p0) { - tBoilingSurface = tBoilingSurface - (Td-this->Tc_)/Niter; + TBoil = TBoil - (T0 - Tc0)/nIter; } else { @@ -398,51 +347,52 @@ Foam::scalar Foam::SprayParcel::chi } } - scalar hl = td.cloud().composition().liquids().properties()[i].hl(pAmb, tBoilingSurface); - scalar iTp = td.cloud().composition().liquids().properties()[i].h(pAmb, Td) - pAmb/td.cloud().composition().liquids().properties()[i].rho(pAmb, Td); - scalar iTb = td.cloud().composition().liquids().properties()[i].h(pAmb, tBoilingSurface) - pAmb/td.cloud().composition().liquids().properties()[i].rho(pAmb, tBoilingSurface); - - chi += X[i]*(iTp-iTb)/hl; + scalar hl = liq.hl(pAmb, TBoil); + scalar iTp = liq.h(pAmb, T0) - liq.rho(pAmb, T0); + scalar iTb = liq.h(pAmb, TBoil) - pAmb/liq.rho(pAmb, TBoil); + chi += X[i]*(iTp - iTb)/hl; } } - // bound chi - chi = max(chi, 0.0); - chi = min(chi, 1.0); + chi = min(1.0, max(chi, 0.0)); - return chi; + return chi; } + template template void Foam::SprayParcel::solveTABEq ( TrackData& td, - const scalar& dt + const scalar dt ) { + typedef typename TrackData::cloudType::reactingCloudType reactingCloudType; + const CompositionModel& composition = + td.cloud().composition(); + const scalar& TABCmu = td.cloud().breakup().TABCmu(); const scalar& TABWeCrit = td.cloud().breakup().TABWeCrit(); const scalar& TABComega = td.cloud().breakup().TABComega(); - - scalar r = 0.5 * this->d_; + scalar r = 0.5*this->d_; scalar r2 = r*r; scalar r3 = r*r2; const scalarField& Y(this->Y()); - scalarField X(td.cloud().composition().liquids().X(Y)); + scalarField X(composition.liquids().X(Y)); - scalar rho = td.cloud().composition().liquids().rho(this->pc_, this->T(), X); - scalar mu = td.cloud().composition().liquids().mu(this->pc_, this->T(), X); - scalar sigma = td.cloud().composition().liquids().sigma(this->pc_, this->T(), X); + scalar rho = composition.liquids().rho(this->pc_, this->T(), X); + scalar mu = composition.liquids().mu(this->pc_, this->T(), X); + scalar sigma = composition.liquids().sigma(this->pc_, this->T(), X); // inverse of characteristic viscous damping time scalar rtd = 0.5*TABCmu*mu/(rho*r2); // oscillation frequency (squared) - scalar omega2 = TABComega * sigma /(rho*r3) - rtd*rtd; + scalar omega2 = TABComega*sigma/(rho*r3) - rtd*rtd; if(omega2 > 0) { @@ -475,13 +425,36 @@ void Foam::SprayParcel::solveTABEq } else { - // reset droplet distortion parameters + // reset distortion parameters this->y() = 0; this->yDot() = 0; } - } + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::SprayParcel::SprayParcel +( + const SprayParcel& p +) +: + ParcelType(p), + d0_(p.d0_), + position0_(p.position0_), + liquidCore_(p.liquidCore_), + KHindex_(p.KHindex_), + y_(p.y_), + yDot_(p.yDot_), + tc_(p.tc_), + ms_(p.ms_), + injector_(p.injector_), + tMom_(p.tMom_), + user_(p.user_) +{} + + // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // #include "SprayParcelIO.C" diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H index af26fee515..2180c2338c 100644 --- a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,16 +25,14 @@ Class Foam::SprayParcel Description - Derived from ReacingParcel, with added functionality - for atomization and breakup + Reacing spray parcel, with added functionality for atomization and breakup \*---------------------------------------------------------------------------*/ #ifndef SprayParcel_H #define SprayParcel_H -#include "ReactingParcel.H" -#include "SprayCloud.H" +#include "particle.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,13 +56,14 @@ Ostream& operator<< template class SprayParcel : - public ReactingParcel + public ParcelType { + protected: - // protected properties + // Protected data - // spray parcel properties + // Spray parcel properties //- initial droplet diameter scalar d0_; @@ -99,67 +98,9 @@ protected: //- passive scalar (extra variable to be defined by user) scalar user_; + public: - //- Class to hold reacting particle constant properties - class constantProperties - : - public ReactingParcel::constantProperties - { - public: - - //- Constructor - constantProperties(const dictionary& parentDict); - }; - - - //- Class used to pass reacting tracking data to the trackToFace function - class trackData - : - public ReactingParcel::trackData - { - - // Private data - - //- Reference to the cloud containing this particle - SprayCloud& cloud_; - - //- Particle constant properties - const constantProperties& constProps_; - - public: - - typedef SprayCloud cloudType; - - - // Constructors - - //- Construct from components - inline trackData - ( - SprayCloud& cloud, - const constantProperties& constProps, - const interpolation& rhoInterp, - const interpolation& UInterp, - const interpolation& muInterp, - const interpolation& TInterp, - const interpolation& CpInterp, - const interpolation& pInterp, - const vector& g - ); - - - // Member functions - - //- Return access to the owner cloud - inline SprayCloud& cloud(); - - //- Return const access to the constant properties - inline const constantProperties& constProps() const; - - }; - - // Static data members //- String representation of properties @@ -169,97 +110,141 @@ public: TypeName("SprayParcel"); - friend class Cloud; - - // Constructors //- Construct from owner, position, and cloud owner // Other properties initialised as null inline SprayParcel ( - SprayCloud& owner, + const polyMesh& mesh, const vector& position, - const label cellI + const label cellI, + const label tetFaceI, + const label tetPtI ); //- Construct from components inline SprayParcel ( - SprayCloud& owner, + const polyMesh& mesh, const vector& position, const label cellI, + const label tetFaceI, + const label tetPtI, const label typeId, const scalar nParticle0, const scalar d0, + const scalar dTarget0, const vector& U0, + const vector& f0, + const vector& angularMomentum0, + const vector& torque0, const scalarField& Y0, - const scalar& dInit, - const scalar& liquidCore, - const scalar& KHindex, - const scalar& y, - const scalar& yDot, - const scalar& tc, - const scalar& ms, - const scalar& injector, - const scalar& tMom, - const scalar& user, - const constantProperties& constProps + const scalar liquidCore, + const scalar KHindex, + const scalar y, + const scalar yDot, + const scalar tc, + const scalar ms, + const scalar injector, + const scalar tMom, + const scalar user, + const typename ParcelType::constantProperties& constProps ); //- Construct from Istream SprayParcel ( - const Cloud& c, + const polyMesh& mesh, Istream& is, bool readFields = true ); + //- Construct as a copy + SprayParcel + ( + const SprayParcel& p, + const polyMesh& mesh + ); + //- Construct as a copy SprayParcel(const SprayParcel& p); - //- Construct and return a clone - autoPtr clone() const + //- Construct and return a (basic particle) clone + virtual autoPtr clone() const { - return autoPtr(new SprayParcel(*this)); + return autoPtr(new SprayParcel(*this)); } + //- Construct and return a (basic particle) clone + virtual autoPtr clone(const polyMesh& mesh) const + { + return autoPtr + ( + new SprayParcel(*this, mesh) + ); + } + + //- Factory class to read-construct particles used for + // parallel transfer + class iNew + { + const polyMesh& mesh_; + + public: + + iNew(const polyMesh& mesh) + : + mesh_(mesh) + {} + + autoPtr > operator()(Istream& is) const + { + return autoPtr > + ( + new SprayParcel(mesh_, is, true) + ); + } + }; + + // Member Functions // Access //- Return const access to initial droplet diameter - inline const scalar& d0() const; + inline scalar d0() const; //- Return const access to initial droplet position inline const vector& position0() const; //- Return const access to liquid core - inline const scalar& liquidCore() const; + inline scalar liquidCore() const; //- Return const access to Kelvin-Helmholtz breakup index - inline const scalar& KHindex() const; + inline scalar KHindex() const; //- Return const access to spherical deviation - inline const scalar& y() const; + inline scalar y() const; //- Return const access to rate of change of spherical deviation - inline const scalar& yDot() const; + inline scalar yDot() const; //- Return const access to atomization characteristic time - inline const scalar& tc() const; + inline scalar tc() const; //- Return const access to stripped parcel mass - inline const scalar& ms() const; + inline scalar ms() const; //- Return const access to injector id - inline const scalar& injector() const; + inline scalar injector() const; //- Return const access to momentum relaxation time - inline const scalar& tMom() const; + inline scalar tMom() const; //- Return const access to passive user scalar - inline const scalar& user() const; + inline scalar user() const; + // Edit @@ -358,7 +343,8 @@ public: const label cellI ); - //- Calculate the chi-factor for flash-boiling for the atomization model + //- Calculate the chi-factor for flash-boiling for the + // atomization model template scalar chi ( @@ -366,22 +352,40 @@ public: const scalarField& X ) const; - //- Solve the TAB equation template void solveTABEq ( TrackData& td, - const scalar& dt + const scalar dt ); + // I-O //- Read - static void readFields(Cloud& c); + template + static void readFields + ( + CloudType& c, + const CompositionType& compModel + ); + + //- Read - no composition + template + static void readFields(CloudType& c); //- Write - static void writeFields(const Cloud& c); + template + static void writeFields + ( + const CloudType& c, + const CompositionType& compModel + ); + + //- Write - composition supplied + template + static void writeFields(const CloudType& c); // Ostream Operator diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H index f54aac2bb4..9e8984132e 100644 --- a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelI.H @@ -25,77 +25,21 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -inline Foam::SprayParcel::constantProperties::constantProperties -( - const dictionary& parentDict -) -: - ReactingParcel::constantProperties - ( - parentDict, - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("rhoMin")).value(), - 1000.0, // rho0 bypassed - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("minParticleMass")).value(), - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("T0")).value(), - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("TMin")).value(), - 4000.0, // cp0 bypassed - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("epsilon0")).value(), - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("f0")).value(), - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("Pr")).value(), - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("pMin")).value(), - false, // constant volume - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("Tvap")).value(), - dimensionedScalar((parentDict.subDict("constantProperties")).lookup("Tbp")).value() - ) -{ - -} - - -template -inline Foam::SprayParcel::trackData::trackData -( - SprayCloud& cloud, - const constantProperties& constProps, - const interpolation& rhoInterp, - const interpolation& UInterp, - const interpolation& muInterp, - const interpolation& TInterp, - const interpolation& CpInterp, - const interpolation& pInterp, - const vector& g -) -: - ReactingParcel::trackData - ( - cloud, - constProps, - rhoInterp, - UInterp, - muInterp, - TInterp, - CpInterp, - pInterp, - g - ), - cloud_(cloud), - constProps_(constProps) -{} - - template inline Foam::SprayParcel::SprayParcel ( - SprayCloud& owner, + const polyMesh& mesh, const vector& position, - const label cellI + const label cellI, + const label tetFaceI, + const label tetPtI ) : - ReactingParcel(owner, position, cellI), + ParcelType(mesh, position, cellI, tetFaceI, tetPtI), d0_(this->d()), position0_(position), - liquidCore_(owner.atomization().initLiquidCore()), +// liquidCore_(owner.atomization().initLiquidCore()), + liquidCore_(0.0), KHindex_(0.0), y_(0.0), yDot_(0.0), @@ -110,40 +54,51 @@ inline Foam::SprayParcel::SprayParcel template inline Foam::SprayParcel::SprayParcel ( - SprayCloud& owner, + const polyMesh& mesh, const vector& position, const label cellI, + const label tetFaceI, + const label tetPtI, const label typeId, const scalar nParticle0, const scalar d0, + const scalar dTarget0, const vector& U0, + const vector& f0, + const vector& angularMomentum0, + const vector& torque0, const scalarField& Y0, - const scalar& dInit, - const scalar& liquidCore, - const scalar& KHindex, - const scalar& y, - const scalar& yDot, - const scalar& tc, - const scalar& ms, - const scalar& injector, - const scalar& tMom, - const scalar& user, - const constantProperties& constProps + const scalar liquidCore, + const scalar KHindex, + const scalar y, + const scalar yDot, + const scalar tc, + const scalar ms, + const scalar injector, + const scalar tMom, + const scalar user, + const typename ParcelType::constantProperties& constProps ) : - ReactingParcel + ParcelType ( - owner, + mesh, position, cellI, + tetFaceI, + tetPtI, typeId, nParticle0, d0, + dTarget0, U0, + f0, + angularMomentum0, + torque0, Y0, constProps ), - d0_(dInit), + d0_(d0), position0_(position), liquidCore_(liquidCore), KHindex_(KHindex), @@ -156,149 +111,149 @@ inline Foam::SprayParcel::SprayParcel user_(user) {} -// * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * // - -template -inline Foam::SprayCloud& -Foam::SprayParcel::trackData::cloud() -{ - return cloud_; -} - - -template -inline const typename Foam::SprayParcel::constantProperties& -Foam::SprayParcel::trackData::constProps() const -{ - return constProps_; -} - - // * * * * * * * * * * SprayParcel Member Functions * * * * * * * * * * * * // template -inline const Foam::scalar& Foam::SprayParcel::d0() const +inline Foam::scalar Foam::SprayParcel::d0() const { return d0_; } + template inline const Foam::vector& Foam::SprayParcel::position0() const { return position0_; } + template -inline const Foam::scalar& Foam::SprayParcel::liquidCore() const +inline Foam::scalar Foam::SprayParcel::liquidCore() const { return liquidCore_; } + template -inline const Foam::scalar& Foam::SprayParcel::KHindex() const +inline Foam::scalar Foam::SprayParcel::KHindex() const { return KHindex_; } + template -inline const Foam::scalar& Foam::SprayParcel::y() const +inline Foam::scalar Foam::SprayParcel::y() const { return y_; } + template -inline const Foam::scalar& Foam::SprayParcel::yDot() const +inline Foam::scalar Foam::SprayParcel::yDot() const { return yDot_; } template -inline const Foam::scalar& Foam::SprayParcel::tc() const +inline Foam::scalar Foam::SprayParcel::tc() const { return tc_; } + template -inline const Foam::scalar& Foam::SprayParcel::ms() const +inline Foam::scalar Foam::SprayParcel::ms() const { return ms_; } + template -inline const Foam::scalar& Foam::SprayParcel::injector() const +inline Foam::scalar Foam::SprayParcel::injector() const { return injector_; } + template -inline const Foam::scalar& Foam::SprayParcel::tMom() const +inline Foam::scalar Foam::SprayParcel::tMom() const { return tMom_; } template -inline const Foam::scalar& Foam::SprayParcel::user() const +inline Foam::scalar Foam::SprayParcel::user() const { return user_; } + template inline Foam::scalar& Foam::SprayParcel::d0() { return d0_; } + template inline Foam::vector& Foam::SprayParcel::position0() { return position0_; } + template inline Foam::scalar& Foam::SprayParcel::liquidCore() { return liquidCore_; } + template inline Foam::scalar& Foam::SprayParcel::KHindex() { return KHindex_; } + template inline Foam::scalar& Foam::SprayParcel::y() { return y_; } + template inline Foam::scalar& Foam::SprayParcel::yDot() { return yDot_; } + template inline Foam::scalar& Foam::SprayParcel::tc() { return tc_; } + template inline Foam::scalar& Foam::SprayParcel::ms() { return ms_; } + template inline Foam::scalar& Foam::SprayParcel::injector() { return injector_; } + template inline Foam::scalar& Foam::SprayParcel::tMom() { @@ -311,3 +266,6 @@ inline Foam::scalar& Foam::SprayParcel::user() { return user_; } + + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelIO.C b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelIO.C index 1122f4fdb3..a4c66ce964 100644 --- a/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelIO.C +++ b/src/lagrangian/spray/parcels/Templates/SprayParcel/SprayParcelIO.C @@ -30,18 +30,18 @@ License template Foam::string Foam::SprayParcel::propHeader = - ReactingParcel::propHeader - + " d0" - + " position0" - + " liquidCore" - + " KHindex" - + " y" - + " yDot" - + " tc" - + " ms" - + " injector" - + " tMom" - + " user"; + ParcelType::propHeader + + " d0" + + " position0" + + " liquidCore" + + " KHindex" + + " y" + + " yDot" + + " tc" + + " ms" + + " injector" + + " tMom" + + " user"; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -49,12 +49,12 @@ Foam::string Foam::SprayParcel::propHeader = template Foam::SprayParcel::SprayParcel ( - const Cloud& cloud, + const polyMesh& mesh, Istream& is, bool readFields ) : - ReactingParcel(cloud, is, readFields), + ParcelType(mesh, is, readFields), d0_(0.0), position0_(vector::zero), liquidCore_(0.0), @@ -109,7 +109,7 @@ Foam::SprayParcel::SprayParcel ( "SprayParcel::SprayParcel" "(" - "const Cloud&, " + "const polyMesh, " "Istream&, " "bool" ")" @@ -118,25 +118,46 @@ Foam::SprayParcel::SprayParcel template -void Foam::SprayParcel::readFields(Cloud& cIn) +template +void Foam::SprayParcel::readFields(CloudType& c) { - if (!cIn.size()) + if (!c.size()) { return; } - SprayCloud& c = - dynamic_cast&>(cIn); + ParcelType::readFields(c); +} - ReactingParcel::readFields(c); + +template +template +void Foam::SprayParcel::readFields +( + CloudType& c, + const CompositionType& compModel +) +{ + if (!c.size()) + { + return; + } + + ParcelType::readFields(c, compModel); IOField d0(c.fieldIOobject("d0", IOobject::MUST_READ)); c.checkFieldIOobject(c, d0); - IOField position0(c.fieldIOobject("position0", IOobject::MUST_READ)); + IOField position0 + ( + c.fieldIOobject("position0", IOobject::MUST_READ) + ); c.checkFieldIOobject(c, position0); - IOField liquidCore(c.fieldIOobject("liquidCore", IOobject::MUST_READ)); + IOField liquidCore(c.fieldIOobject + ( + "liquidCore", IOobject::MUST_READ) + ); c.checkFieldIOobject(c, liquidCore); IOField KHindex(c.fieldIOobject("KHindex", IOobject::MUST_READ)); @@ -164,7 +185,7 @@ void Foam::SprayParcel::readFields(Cloud& cIn) c.checkFieldIOobject(c, user); label i = 0; - forAllIter(typename Cloud, c, iter) + forAllIter(typename Cloud >, c, iter) { SprayParcel& p = iter(); p.d0_ = d0[i]; @@ -184,32 +205,51 @@ void Foam::SprayParcel::readFields(Cloud& cIn) template +template +void Foam::SprayParcel::writeFields(const CloudType& c) +{ + ParcelType::writeFields(c); +} + + +template +template void Foam::SprayParcel::writeFields ( - const Cloud& cIn + const CloudType& c, + const CompositionType& compModel ) { - const SprayCloud& c = - dynamic_cast&>(cIn); - - ReactingParcel::writeFields(c); + ParcelType::writeFields(c, compModel); label np = c.size(); IOField d0(c.fieldIOobject("d0", IOobject::NO_READ), np); - IOField position0(c.fieldIOobject("position0", IOobject::NO_READ), np); - IOField liquidCore(c.fieldIOobject("liquidCore", IOobject::NO_READ), np); + IOField position0 + ( + c.fieldIOobject("position0", IOobject::NO_READ), + np + ); + IOField liquidCore + ( + c.fieldIOobject("liquidCore", IOobject::NO_READ), + np + ); IOField KHindex(c.fieldIOobject("KHindex", IOobject::NO_READ), np); IOField y(c.fieldIOobject("y", IOobject::NO_READ), np); IOField yDot(c.fieldIOobject("yDot", IOobject::NO_READ), np); IOField tc(c.fieldIOobject("tc", IOobject::NO_READ), np); IOField ms(c.fieldIOobject("ms", IOobject::NO_READ), np); - IOField injector(c.fieldIOobject("injector", IOobject::NO_READ), np); + IOField injector + ( + c.fieldIOobject("injector", IOobject::NO_READ), + np + ); IOField tMom(c.fieldIOobject("tMom", IOobject::NO_READ), np); IOField user(c.fieldIOobject("user", IOobject::NO_READ), np); label i = 0; - forAllConstIter(typename Cloud, c, iter) + forAllConstIter(typename Cloud >, c, iter) { const SprayParcel& p = iter(); d0[i] = p.d0_; @@ -251,7 +291,7 @@ Foam::Ostream& Foam::operator<< { if (os.format() == IOstream::ASCII) { - os << static_cast&>(p) + os << static_cast(p) << token::SPACE << p.d0() << token::SPACE << p.position0() << token::SPACE << p.liquidCore() @@ -266,13 +306,21 @@ Foam::Ostream& Foam::operator<< } else { - os << static_cast&>(p); - os.write - ( + os << static_cast(p); + os.write + ( reinterpret_cast(&p.d0_), - sizeof(p.d0()) + sizeof(p.position0()) + sizeof(p.liquidCore()) + sizeof(p.KHindex()) - + sizeof(p.y()) + sizeof(p.yDot()) + sizeof(p.tc()) + sizeof(p.ms()) - + sizeof(p.injector()) + sizeof(p.tMom()) + sizeof(p.user()) + sizeof(p.d0()) + + sizeof(p.position0()) + + sizeof(p.liquidCore()) + + sizeof(p.KHindex()) + + sizeof(p.y()) + + sizeof(p.yDot()) + + sizeof(p.tc()) + + sizeof(p.ms()) + + sizeof(p.injector()) + + sizeof(p.tMom()) + + sizeof(p.user()) ); } diff --git a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.C b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.C deleted file mode 100644 index 709dcd4521..0000000000 --- a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.C +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "BasicSprayParcel.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::BasicSprayParcel::BasicSprayParcel -( - SprayCloud >& owner, - const vector& position, - const label cellI -) -: - SprayParcel >(owner, position, cellI) -{} - -template -Foam::BasicSprayParcel::BasicSprayParcel -( - SprayCloud >& owner, - const vector& position, - const label cellI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const vector& U0, - const scalarField& Y0, - const scalar& dInit, - const scalar& liquidCore, - const scalar& KHindex, - const scalar& y, - const scalar& yDot, - const scalar& tc, - const scalar& ms, - const scalar& injector, - const scalar& tMom, - const scalar& user, - const typename SprayParcel >:: - constantProperties& constProps -) -: - SprayParcel > - ( - owner, - position, - cellI, - typeId, - nParticle0, - d0, - U0, - Y0, - dInit, - liquidCore, - KHindex, - y, - yDot, - tc, - ms, - injector, - tMom, - user, - constProps - ) -{} - -template -Foam::BasicSprayParcel::BasicSprayParcel -( - const Cloud >& cloud, - Istream& is, - bool readFields -) -: - SprayParcel >(cloud, is, readFields) -{} - - -template -Foam::BasicSprayParcel::BasicSprayParcel -( - const BasicSprayParcel& p -) -: - SprayParcel(p) -{} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // - -template -Foam::BasicSprayParcel::~BasicSprayParcel() -{} - - - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.H b/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.H deleted file mode 100644 index 8738177faf..0000000000 --- a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/BasicSprayParcel.H +++ /dev/null @@ -1,147 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -Class - Foam::BasicSprayParcel - -Description - -SourceFiles - BasicSprayParcelI.H - BasicSprayParcel.C - BasicSprayParcelIO.C - -\*---------------------------------------------------------------------------*/ - -#ifndef BasicSprayParcel_H -#define BasicSprayParcel_H - -#include "SprayParcel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of classes -template -class BasicSprayParcel; - -/*---------------------------------------------------------------------------*\ - Class BasicSprayParcel Declaration -\*---------------------------------------------------------------------------*/ - -template -class BasicSprayParcel -: - public SprayParcel > -{ - -public: - - //- The type of thermodynamics this parcel was instantiated for - typedef ThermoType thermoType; - - //- Run-time type information - TypeName("BasicSprayParcel"); - - // Constructors - - //- Construct from owner, position, and cloud owner - // Other properties initialised as null - BasicSprayParcel - ( - SprayCloud& owner, - const vector& position, - const label cellI - ); - - //- Construct from components - BasicSprayParcel - ( - SprayCloud& owner, - const vector& position, - const label cellI, - const label typeId, - const scalar nParticle0, - const scalar d0, - const vector& U0, - const scalarField& Y0, - const scalar& dInit, - const scalar& liquidCore, - const scalar& KHindex, - const scalar& y, - const scalar& yDot, - const scalar& tc, - const scalar& ms, - const scalar& injector, - const scalar& tMom, - const scalar& user, - const typename SprayParcel:: - constantProperties& constProps - ); - - //- Construct from Istream - BasicSprayParcel - ( - const Cloud& c, - Istream& is, - bool readFields = true - ); - - //- Construct as a copy - BasicSprayParcel(const BasicSprayParcel& p); - - //- Construct and return a clone - autoPtr clone() const - { - return - autoPtr - ( - new BasicSprayParcel(*this) - ); - } - - - //- Destructor - virtual ~BasicSprayParcel(); - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "BasicSprayParcel.C" -#endif - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/derived/basicSprayParcel/basicSprayParcel.H b/src/lagrangian/spray/parcels/derived/basicSprayParcel/basicSprayParcel.H new file mode 100644 index 0000000000..79f3941f8c --- /dev/null +++ b/src/lagrangian/spray/parcels/derived/basicSprayParcel/basicSprayParcel.H @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +Class + Foam::basicSprayParcel + +Description + Definition of spray parcel + +SourceFiles + basicSprayParcel.C + basicSprayParcelIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef basicSprayParcel_H +#define basicSprayParcel_H + +#include "contiguous.H" +#include "particle.H" +#include "KinematicParcel.H" +#include "ThermoParcel.H" +#include "ReactingParcel.H" +#include "SprayParcel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef SprayParcel + < + ReactingParcel + < + ThermoParcel + < + KinematicParcel + < + particle + > + > + > + > basicSprayParcel; + + template<> + inline bool contiguous() + { + return false; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/defineBasicSprayParcel.C b/src/lagrangian/spray/parcels/derived/basicSprayParcel/defineBasicSprayParcel.C similarity index 84% rename from src/lagrangian/spray/parcels/derived/BasicSprayParcel/defineBasicSprayParcel.C rename to src/lagrangian/spray/parcels/derived/basicSprayParcel/defineBasicSprayParcel.C index c8c4747db9..c55d0098a1 100644 --- a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/defineBasicSprayParcel.C +++ b/src/lagrangian/spray/parcels/derived/basicSprayParcel/defineBasicSprayParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,14 +23,15 @@ License \*---------------------------------------------------------------------------*/ -#include "createSprayParcelTypes.H" -#include "BasicSprayParcel.H" +#include "basicSprayParcel.H" +#include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - createSprayParcelType(BasicSprayParcel); + defineTemplateTypeNameAndDebug(basicSprayParcel, 0); + defineTemplateTypeNameAndDebug(Cloud, 0); }; diff --git a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/makeBasicSprayParcelSubmodels.C b/src/lagrangian/spray/parcels/derived/basicSprayParcel/makeBasicSprayParcelSubmodels.C similarity index 59% rename from src/lagrangian/spray/parcels/derived/BasicSprayParcel/makeBasicSprayParcelSubmodels.C rename to src/lagrangian/spray/parcels/derived/basicSprayParcel/makeBasicSprayParcelSubmodels.C index a37b6a0a89..45e5c3982b 100644 --- a/src/lagrangian/spray/parcels/derived/BasicSprayParcel/makeBasicSprayParcelSubmodels.C +++ b/src/lagrangian/spray/parcels/derived/basicSprayParcel/makeBasicSprayParcelSubmodels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,21 +23,22 @@ License \*---------------------------------------------------------------------------*/ -#include "BasicSprayParcel.H" +#include "basicSprayCloud.H" + +#include "makeParcelCloudFunctionObjects.H" // Kinematic -#include "makeSprayParcelDispersionModels.H" -#include "makeSprayParcelDragModels.H" -#include "makeSprayParcelInjectionModels.H" -#include "makeSprayParcelPatchInteractionModels.H" -#include "makeSprayParcelPostProcessingModels.H" +#include "makeThermoParcelForces.H" // thermo variant +#include "makeParcelDispersionModels.H" +#include "makeSprayParcelInjectionModels.H" // Spray variant +#include "makeParcelPatchInteractionModels.H" // Thermodynamic -#include "makeSprayParcelHeatTransferModels.H" +#include "makeParcelHeatTransferModels.H" // Reacting -#include "makeSprayParcelCompositionModels.H" -#include "makeSprayParcelPhaseChangeModels.H" +#include "makeReactingParcelCompositionModels.H" +#include "makeReactingParcelPhaseChangeModels.H" // Spray #include "makeSprayParcelAtomizationModels.H" @@ -48,25 +49,25 @@ License namespace Foam { + makeParcelCloudFunctionObjects(basicSprayCloud); + // Kinematic sub-models - makeSprayDispersionModels(BasicSprayParcel); - makeSprayDragModels(BasicSprayParcel); - makeSprayInjectionModels(BasicSprayParcel); - makeSprayPatchInteractionModels(BasicSprayParcel); - makeSprayPostProcessingModels(BasicSprayParcel); + makeThermoParcelForces(basicSprayCloud); + makeParcelDispersionModels(basicSprayCloud); + makeSprayParcelInjectionModels(basicSprayCloud); + makeParcelPatchInteractionModels(basicSprayCloud); // Thermo sub-models - makeSprayHeatTransferModels(BasicSprayParcel); + makeParcelHeatTransferModels(basicSprayCloud); // Reacting sub-models - makeSprayCompositionModels(BasicSprayParcel); - makeSprayPhaseChangeModels(BasicSprayParcel); + makeReactingParcelCompositionModels(basicSprayCloud); + makeReactingParcelPhaseChangeModels(basicSprayCloud); // Spray sub-models - makeSprayAtomizationModels(BasicSprayParcel); - makeSprayBreakupModels(BasicSprayParcel); - makeSprayCollisionModels(BasicSprayParcel); - + makeSprayParcelAtomizationModels(basicSprayCloud); + makeSprayParcelBreakupModels(basicSprayCloud); +// makeSprayParcelCollisionModels(basicSprayCloud); }; diff --git a/src/lagrangian/spray/parcels/include/createSprayParcelTypes.H b/src/lagrangian/spray/parcels/include/createSprayParcelTypes.H deleted file mode 100644 index 9020d8fc0a..0000000000 --- a/src/lagrangian/spray/parcels/include/createSprayParcelTypes.H +++ /dev/null @@ -1,71 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef createSprayParcelTypes_H -#define createSprayParcelTypes_H - -#include "thermoPhysicsTypes.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define createSprayParcelType(ParcelType) \ - \ - createSprayParcelThermoType(ParcelType, gasThermoPhysics); \ - createSprayParcelThermoType(ParcelType, constGasThermoPhysics); \ - createSprayParcelThermoType(ParcelType, icoPoly8ThermoPhysics); - - -#define createSprayParcelThermoType(ParcelType, ThermoType) \ - \ - typedef ParcelType ParcelType##ThermoType; \ - \ - defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \ - defineTemplateTypeNameAndDebug(Particle, 0); \ - defineTemplateTypeNameAndDebug(Cloud, 0); \ - \ - defineParcelTypeNameAndDebug(KinematicParcel, 0); \ - defineTemplateTypeNameAndDebug \ - ( \ - KinematicParcel, \ - 0 \ - ); \ - defineParcelTypeNameAndDebug(ThermoParcel, 0); \ - defineTemplateTypeNameAndDebug(ThermoParcel, 0); \ - defineParcelTypeNameAndDebug(ReactingParcel, 0); \ - defineTemplateTypeNameAndDebug(ReactingParcel, 0);\ - defineParcelTypeNameAndDebug(SprayParcel, 0); \ - defineTemplateTypeNameAndDebug(SprayParcel, 0); \ - \ - defineParcelTypeNameAndDebug(KinematicCloud, 0); \ - defineParcelTypeNameAndDebug(ThermoCloud, 0); \ - defineParcelTypeNameAndDebug(ReactingCloud, 0); \ - defineParcelTypeNameAndDebug(SprayCloud, 0); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelAtomizationModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelAtomizationModels.H index 382d72fe1d..ee2c9e1d7e 100644 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelAtomizationModels.H +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelAtomizationModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,59 +28,18 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" -#include "SprayCloud.H" - #include "NoAtomization.H" #include "BlobsSheetAtomization.H" #include "LISAAtomization.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeSprayAtomizationModels(ParcelType) \ +#define makeSprayParcelAtomizationModels(CloudType) \ \ - makeSprayAtomizationModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeSprayAtomizationModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeSprayAtomizationModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - -#define makeSprayAtomizationModelThermoType(ParcelType, ThermoType) \ - \ - makeAtomizationModel(SprayCloud >); \ - \ - makeAtomizationModelThermoType \ - ( \ - NoAtomization, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeAtomizationModelThermoType \ - ( \ - BlobsSheetAtomization, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeAtomizationModelThermoType \ - ( \ - LISAAtomization, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); + makeAtomizationModel(CloudType); \ + makeAtomizationModelType(NoAtomization, CloudType); \ + makeAtomizationModelType(BlobsSheetAtomization, CloudType); \ + makeAtomizationModelType(LISAAtomization, CloudType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelBreakupModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelBreakupModels.H index 69ffa8c294..993e40d89b 100644 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelBreakupModels.H +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelBreakupModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,98 +28,27 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" -#include "SprayCloud.H" - #include "NoBreakup.H" +#include "PilchErdman.H" #include "ReitzDiwakar.H" #include "ReitzKHRT.H" #include "TAB.H" #include "ETAB.H" #include "SHF.H" -#include "PilchErdman.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeSprayBreakupModels(ParcelType) \ +#define makeSprayParcelBreakupModels(CloudType) \ \ - makeSprayBreakupModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeSprayBreakupModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeSprayBreakupModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); + makeBreakupModel(CloudType) \ + makeBreakupModelType(NoBreakup, CloudType); \ + makeBreakupModelType(PilchErdman, CloudType); \ + makeBreakupModelType(ReitzDiwakar, CloudType); \ + makeBreakupModelType(ReitzKHRT, CloudType); \ + makeBreakupModelType(TAB, CloudType); \ + makeBreakupModelType(ETAB, CloudType); \ + makeBreakupModelType(SHF, CloudType); -#define makeSprayBreakupModelThermoType(ParcelType, ThermoType) \ - \ - makeBreakupModel(SprayCloud >); \ - \ - makeBreakupModelThermoType \ - ( \ - NoBreakup, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeBreakupModelThermoType \ - ( \ - PilchErdman, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeBreakupModelThermoType \ - ( \ - SHF, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeBreakupModelThermoType \ - ( \ - ETAB, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeBreakupModelThermoType \ - ( \ - TAB, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeBreakupModelThermoType \ - ( \ - ReitzKHRT, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeBreakupModelThermoType \ - ( \ - ReitzDiwakar, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelCollisionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelCollisionModels.H index bc9816ca59..0347201fcf 100644 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelCollisionModels.H +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelCollisionModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,60 +28,19 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" -#include "SprayCloud.H" - #include "NoCollision.H" #include "ORourkeCollision.H" #include "TrajectoryCollision.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeSprayCollisionModels(ParcelType) \ +#define makeSprayParcelCollisionModels(CloudType) \ \ - makeSprayCollisionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeSprayCollisionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeSprayCollisionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); + makeCollisionModel(CloudType); \ + makeCollisionModelType(NoCollision, CloudType); \ + makeCollisionModelType(ORourkeCollision, CloudType); \ + makeCollisionModelType(TrajectoryCollision, CloudType); -#define makeSprayCollisionModelThermoType(ParcelType, ThermoType) \ - \ - makeCollisionModel(SprayCloud >); \ - \ - makeCollisionModelThermoType \ - ( \ - NoCollision, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeCollisionModelThermoType \ - ( \ - ORourkeCollision, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeCollisionModelThermoType \ - ( \ - TrajectoryCollision, \ - SprayCloud, \ - ParcelType, \ - ThermoType \ - ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelCompositionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelCompositionModels.H deleted file mode 100644 index 3ffb8fc3e0..0000000000 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelCompositionModels.H +++ /dev/null @@ -1,74 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeSprayParcelCompositionModels_H -#define makeSprayParcelCompositionModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "SprayCloud.H" - -#include "SinglePhaseMixture.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeSprayCompositionModels(ParcelType) \ - \ - makeSprayCompositionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeSprayCompositionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeSprayCompositionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeSprayCompositionModelThermoType(ParcelType, ThermoType) \ - \ - makeCompositionModel(ReactingCloud >); \ - \ - makeCompositionModelThermoType \ - ( \ - SinglePhaseMixture, \ - ReactingCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelDispersionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelDispersionModels.H deleted file mode 100644 index 40054d6197..0000000000 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelDispersionModels.H +++ /dev/null @@ -1,98 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeSprayParcelDispersionModels_H -#define makeSprayParcelDispersionModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "NoDispersion.H" -#include "GradientDispersionRAS.H" -#include "StochasticDispersionRAS.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeSprayDispersionModels(ParcelType) \ - \ - makeSprayDispersionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeSprayDispersionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeSprayDispersionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeSprayDispersionModelThermoType(ParcelType, ThermoType) \ - \ - makeDispersionModel(KinematicCloud >); \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - DispersionRASModel > >, \ - 0 \ - ); \ - \ - makeDispersionModelThermoType \ - ( \ - NoDispersion, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeDispersionModelThermoType \ - ( \ - GradientDispersionRAS, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeDispersionModelThermoType \ - ( \ - StochasticDispersionRAS, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelDragModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelDragModels.H deleted file mode 100644 index a11c46a21d..0000000000 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelDragModels.H +++ /dev/null @@ -1,82 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeSprayParcelDragModels_H -#define makeSprayParcelDragModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "NoDrag.H" -#include "SphereDrag.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeSprayDragModels(ParcelType) \ - \ - makeSprayDragModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeSprayDragModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeSprayDragModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeSprayDragModelThermoType(ParcelType, ThermoType) \ - \ - makeDragModel(KinematicCloud >); \ - \ - makeDragModelThermoType \ - ( \ - NoDrag, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeDragModelThermoType \ - ( \ - SphereDrag, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelHeatTransferModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelHeatTransferModels.H deleted file mode 100644 index 6585d2fbf8..0000000000 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelHeatTransferModels.H +++ /dev/null @@ -1,82 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeSprayParcelHeatTransferModels_H -#define makeSprayParcelHeatTransferModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "ThermoCloud.H" - -#include "NoHeatTransfer.H" -#include "RanzMarshall.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeSprayHeatTransferModels(ParcelType) \ - \ - makeSprayHeatTransferModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeSprayHeatTransferModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeSprayHeatTransferModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeSprayHeatTransferModelThermoType(ParcelType, ThermoType) \ - \ - makeHeatTransferModel(ThermoCloud >); \ - \ - makeHeatTransferModelThermoType \ - ( \ - NoHeatTransfer, \ - ThermoCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeHeatTransferModelThermoType \ - ( \ - RanzMarshall, \ - ThermoCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H index 07d07ce0a1..513bd6c213 100644 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H +++ b/src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,119 +28,30 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - #include "ConeInjection.H" -#include "ConeInjectionMP.H" #include "FieldActivatedInjection.H" #include "ManualInjection.H" #include "NoInjection.H" #include "PatchInjection.H" -#include "UnitInjection.H" -#include "CommonRailInjection.H" -#include "MultiHoleInjection.H" -//#include "ReactingLookupTableInjection.H" +//#include "UnitInjection.H" +//#include "CommonRailInjection.H" +//#include "MultiHoleInjection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeSprayInjectionModels(ParcelType) \ +#define makeSprayParcelInjectionModels(CloudType) \ \ - makeSprayInjectionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeSprayInjectionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeSprayInjectionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); + makeInjectionModel(CloudType); \ + makeInjectionModelType(ConeInjection, CloudType); \ + makeInjectionModelType(FieldActivatedInjection, CloudType); \ + makeInjectionModelType(ManualInjection, CloudType); \ + makeInjectionModelType(NoInjection, CloudType); \ + makeInjectionModelType(PatchInjection, CloudType); \ +// makeSprayInjectionModelType(UnitInjection, CloudType); \ +// makeSprayInjectionModelType(CommonRailInjection, CloudType); \ +// makeSprayInjectionModelType(MultiHoleInjection, CloudType); -#define makeSprayInjectionModelThermoType(ParcelType, ThermoType) \ - \ - makeInjectionModel(KinematicCloud >); \ - \ - makeInjectionModelThermoType \ - ( \ - ConeInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeInjectionModelThermoType \ - ( \ - ConeInjectionMP, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeInjectionModelThermoType \ - ( \ - FieldActivatedInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeInjectionModelThermoType \ - ( \ - ManualInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeInjectionModelThermoType \ - ( \ - NoInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeInjectionModelThermoType \ - ( \ - PatchInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeInjectionModelThermoType \ - ( \ - CommonRailInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeInjectionModelThermoType \ - ( \ - MultiHoleInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeInjectionModelThermoType \ - ( \ - UnitInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); -/* - makeInjectionModelThermoType \ - ( \ - SprayLookupTableInjection, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); -*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelPatchInteractionModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelPatchInteractionModels.H deleted file mode 100644 index fdec7fafa4..0000000000 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelPatchInteractionModels.H +++ /dev/null @@ -1,92 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeSprayParcelPatchInteractionModels_H -#define makeSprayParcelPatchInteractionModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "LocalInteraction.H" -#include "Rebound.H" -#include "StandardWallInteraction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeSprayPatchInteractionModels(ParcelType) \ - \ - makeSprayPatchInteractionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeSprayPatchInteractionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeSprayPatchInteractionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeSprayPatchInteractionModelThermoType(ParcelType, ThermoType) \ - \ - makePatchInteractionModel(KinematicCloud >); \ - \ - makePatchInteractionModelThermoType \ - ( \ - LocalInteraction, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makePatchInteractionModelThermoType \ - ( \ - Rebound, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makePatchInteractionModelThermoType \ - ( \ - StandardWallInteraction, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelPhaseChangeModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelPhaseChangeModels.H deleted file mode 100644 index 3e207ac88c..0000000000 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelPhaseChangeModels.H +++ /dev/null @@ -1,84 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeSprayParcelPhaseChangeModels_H -#define makeSprayParcelPhaseChangeModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "SprayCloud.H" - -#include "NoPhaseChange.H" -#include "LiquidEvaporation.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeSprayPhaseChangeModels(ParcelType) \ - \ - makeSprayPhaseChangeModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeSprayPhaseChangeModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeSprayPhaseChangeModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeSprayPhaseChangeModelThermoType(ParcelType, ThermoType) \ - \ - makePhaseChangeModel(ReactingCloud >); \ - \ - makePhaseChangeModelThermoType \ - ( \ - NoPhaseChange, \ - ReactingCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makePhaseChangeModelThermoType \ - ( \ - LiquidEvaporation, \ - ReactingCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/parcels/include/makeSprayParcelPostProcessingModels.H b/src/lagrangian/spray/parcels/include/makeSprayParcelPostProcessingModels.H deleted file mode 100644 index 6fdf9db6a7..0000000000 --- a/src/lagrangian/spray/parcels/include/makeSprayParcelPostProcessingModels.H +++ /dev/null @@ -1,84 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeSprayParcelPostProcessingModels_H -#define makeSprayParcelPostProcessingModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "NoPostProcessing.H" -#include "PatchPostProcessing.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeSprayPostProcessingModels(ParcelType) \ - \ - makeSprayPostProcessingModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeSprayPostProcessingModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeSprayPostProcessingModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeSprayPostProcessingModelThermoType(ParcelType, ThermoType) \ - \ - makePostProcessingModel(KinematicCloud >); \ - \ - makePostProcessingModelThermoType \ - ( \ - NoPostProcessing, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makePostProcessingModelThermoType \ - ( \ - PatchPostProcessing, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.C b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModel.C similarity index 58% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.C rename to src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModel.C index bd96036e95..9fea0cb7e7 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.C +++ b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModel.C @@ -33,9 +33,17 @@ Foam::AtomizationModel::AtomizationModel CloudType& owner ) : - dict_(dictionary::null), - owner_(owner), - coeffDict_(dictionary::null) + SubModelBase(owner) +{} + + +template +Foam::AtomizationModel::AtomizationModel +( + const AtomizationModel& am +) +: + SubModelBase(am) {} @@ -47,9 +55,7 @@ Foam::AtomizationModel::AtomizationModel const word& type ) : - dict_(dict), - owner_(owner), - coeffDict_(dict.subDict(type + "Coeffs")) + SubModelBase(owner, dict, type) {} @@ -61,24 +67,17 @@ Foam::AtomizationModel::~AtomizationModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -const CloudType& Foam::AtomizationModel::owner() const -{ - return owner_; -} - template -const Foam::dictionary& Foam::AtomizationModel::dict() const +Foam::scalar Foam::AtomizationModel::initLiquidCore() const { - return dict_; -} + notImplemented + ( + "Foam::scalar " + "Foam::AtomizationModel::initLiquidCore() const" + ); - -template -const Foam::dictionary& Foam::AtomizationModel::coeffDict() const -{ - return coeffDict_; + return 0.0; } @@ -92,9 +91,63 @@ Foam::scalar Foam::AtomizationModel::Taverage return (2.0*Tl + Tc)/3.0; } + +template +bool Foam::AtomizationModel::calcChi() const +{ + notImplemented("bool Foam::AtomizationModel::calcChi()"); + + return false; +} + + +template +void Foam::AtomizationModel::update +( + const scalar dt, + scalar& d, + scalar& liquidCore, + scalar& tc, + const scalar rho, + const scalar mu, + const scalar sigma, + const scalar volFlowRate, + const scalar rhoAv, + const scalar Urel, + const vector& pos, + const vector& injectionPos, + const scalar pAmbient, + const scalar chi, + cachedRandom& rndGen +) const +{ + notImplemented + ( + "void Foam::AtomizationModel::update" + "(" + "const scalar, " + "scalar&, " + "scalar&, " + "scalar&, " + "const scalar, " + "const scalar, " + "const scalar, " + "const scalar, " + "const scalar, " + "const scalar, " + "const vector&, " + "const vector&, " + "const scalar, " + "const scalar, " + "cachedRandom&" + ") const" + ); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "NewAtomizationModel.C" +#include "AtomizationModelNew.C" // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.H b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModel.H similarity index 72% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.H rename to src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModel.H index 3e93597986..b06f91f7ad 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/AtomizationModel.H +++ b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModel.H @@ -25,11 +25,11 @@ Class Foam::AtomizationModel Description - Templated phase change model class + Templated atomization model class SourceFiles AtomizationModel.C - NewAtomizationModel.C + AtomizationModelNew.C \*---------------------------------------------------------------------------*/ @@ -39,6 +39,7 @@ SourceFiles #include "IOdictionary.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" +#include "SubModelBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,25 +52,13 @@ namespace Foam template class AtomizationModel +: + public SubModelBase { - -protected: - - // Protected data - - //- The cloud dictionary - const dictionary& dict_; - - //- Reference to the owner cloud class - CloudType& owner_; - - //- The coefficient dictionary - const dictionary coeffDict_; - public: //- Runtime type information - TypeName("AtomizationModel"); + TypeName("atomizationModel"); //- Declare runtime constructor selection table declareRunTimeSelectionTable @@ -98,6 +87,18 @@ public: const word& type ); + //- Construct copy + AtomizationModel(const AtomizationModel& am); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new AtomizationModel(*this) + ); + } + //- Destructor virtual ~AtomizationModel(); @@ -111,48 +112,35 @@ public: ); - // Access - - //- Return the owner cloud object - const CloudType& owner() const; - - //- Return the cloud dictionary - const dictionary& dict() const; - - //- Return the coefficient dictionary - const dictionary& coeffDict() const; - - // Member Functions //- initial value of liquidCore - virtual scalar initLiquidCore() const = 0; + virtual scalar initLiquidCore() const; //- Average temperature calculation scalar Taverage(const scalar& Tliq, const scalar& Tc) const; //- flag to indicate if chi needs to be calculated - virtual bool calcChi() const = 0; + virtual bool calcChi() const; virtual void update ( - const scalar& dt, + const scalar dt, scalar& d, scalar& liquidCore, scalar& tc, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const scalar& massflowRate, - const scalar& rhoAv, - const scalar& Urel, + const scalar rho, + const scalar mu, + const scalar sigma, + const scalar volFlowRate, + const scalar rhoAv, + const scalar Urel, const vector& pos, const vector& injectionPos, - const scalar& pAmbient, - const scalar& chi, - Random& rndGen - ) const = 0; - + const scalar pAmbient, + const scalar chi, + cachedRandom& rndGen + ) const; }; @@ -164,26 +152,27 @@ public: #define makeAtomizationModel(CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(AtomizationModel, 0); \ - \ + typedef CloudType::sprayCloudType sprayCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + AtomizationModel, \ + 0 \ + ); \ defineTemplateRunTimeSelectionTable \ ( \ - AtomizationModel, \ + AtomizationModel, \ dictionary \ ); -#define makeAtomizationModelThermoType(SS, CloudType, ParcelType, ThermoType) \ + +#define makeAtomizationModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ + typedef CloudType::sprayCloudType sprayCloudType; \ + defineNamedTemplateTypeNameAndDebug(SS, 0); \ \ - AtomizationModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + AtomizationModel:: \ + adddictionaryConstructorToTable > \ + add##SS##CloudType##sprayCloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/NewAtomizationModel.C b/src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C similarity index 100% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/AtomizationModel/NewAtomizationModel.C rename to src/lagrangian/spray/submodels/AtomizationModel/AtomizationModel/AtomizationModelNew.C diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C b/src/lagrangian/spray/submodels/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C similarity index 74% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C rename to src/lagrangian/spray/submodels/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C index b6262139e0..4e2cbbb9c0 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C +++ b/src/lagrangian/spray/submodels/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.C @@ -34,10 +34,21 @@ Foam::BlobsSheetAtomization::BlobsSheetAtomization CloudType& owner ) : - AtomizationModel(owner), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - B_(readScalar(coeffsDict_.lookup("B"))), - angle_(readScalar(coeffsDict_.lookup("angle"))) + AtomizationModel(dict, owner, typeName), + B_(readScalar(this->coeffDict().lookup("B"))), + angle_(readScalar(this->coeffDict().lookup("angle"))) +{} + + +template +Foam::BlobsSheetAtomization::BlobsSheetAtomization +( + const BlobsSheetAtomization& am +) +: + AtomizationModel(am), + B_(am.B_), + angle_(am.B_) {} @@ -56,46 +67,49 @@ Foam::scalar Foam::BlobsSheetAtomization::initLiquidCore() const return 1.0; } + template bool Foam::BlobsSheetAtomization::calcChi() const { return false; } + template void Foam::BlobsSheetAtomization::update ( - const scalar& dt, + const scalar dt, scalar& d, scalar& liquidCore, scalar& tc, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const scalar& massflowRate, - const scalar& rhoAv, - const scalar& Urel, + const scalar rho, + const scalar mu, + const scalar sigma, + const scalar volFlowRate, + const scalar rhoAv, + const scalar Urel, const vector& pos, const vector& injectionPos, - const scalar& pAmbient, - const scalar& chi, - Random& rndGen + const scalar pAmbient, + const scalar chi, + cachedRandom& rndGen ) const { - - scalar lBU = B_ * sqrt - ( - rho * sigma * d * cos(angle_*mathematicalConstant::pi/360.0) - / sqr(rhoAv*Urel) - ); + scalar lBU = + B_ + * sqrt + ( + rho*sigma*d*cos(angle_*constant::mathematical::pi/360.0) + / sqr(rhoAv*Urel) + ); scalar pWalk = mag(pos - injectionPos); - if ( pWalk > lBU ) + if (pWalk > lBU) { liquidCore = 0.0; } - } + // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H b/src/lagrangian/spray/submodels/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H similarity index 80% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H rename to src/lagrangian/spray/submodels/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H index 99a307b2a7..a4f956b175 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H +++ b/src/lagrangian/spray/submodels/AtomizationModel/BlobsSheetAtomization/BlobsSheetAtomization.H @@ -53,7 +53,7 @@ Description namespace Foam { /*---------------------------------------------------------------------------*\ - Class BlobsSheetAtomization Declaration + Class BlobsSheetAtomization Declaration \*---------------------------------------------------------------------------*/ template @@ -63,15 +63,14 @@ class BlobsSheetAtomization { private: - dictionary coeffsDict_; scalar B_; scalar angle_; - //Random& rndGen_; + public: //- Runtime type information - TypeName("BlobsSheetAtomization"); + TypeName("blobsSheetAtomization"); // Constructors @@ -79,6 +78,18 @@ public: //- Construct from dictionary BlobsSheetAtomization(const dictionary& dict, CloudType& cloud); + //- Construct copy + BlobsSheetAtomization(const BlobsSheetAtomization& am); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new BlobsSheetAtomization(*this) + ); + } + //- Destructor virtual ~BlobsSheetAtomization(); @@ -94,23 +105,22 @@ public: virtual void update ( - const scalar& dt, + const scalar dt, scalar& d, scalar& liquidCore, scalar& tc, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const scalar& massflowRate, - const scalar& rhoAv, - const scalar& Urel, + const scalar rho, + const scalar mu, + const scalar sigma, + const scalar volHlowRate, + const scalar rhoAv, + const scalar Urel, const vector& pos, const vector& injectionPos, - const scalar& pAmbient, - const scalar& chi, - Random& rndGen + const scalar pAmbient, + const scalar chi, + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.C b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISAAtomization.C similarity index 59% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.C rename to src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISAAtomization.C index 23f32b68c9..1cebba9748 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.C +++ b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISAAtomization.C @@ -34,16 +34,15 @@ Foam::LISAAtomization::LISAAtomization CloudType& owner ) : - AtomizationModel(owner), - coeffsDict_(dict.subDict(typeName+"Coeffs")), - Cl_(readScalar(coeffsDict_.lookup("Cl"))), - cTau_(readScalar(coeffsDict_.lookup("cTau"))), - Q_(readScalar(coeffsDict_.lookup("Q"))), - lisaExp_(readScalar(coeffsDict_.lookup("lisaExp"))), - injectorDirection_(coeffsDict_.lookup("injectorDirection")), - SMDCalcMethod_(coeffsDict_.lookup("SMDCalculationMethod")) + AtomizationModel(dict, owner, typeName), + Cl_(readScalar(this->coeffDict().lookup("Cl"))), + cTau_(readScalar(this->coeffDict().lookup("cTau"))), + Q_(readScalar(this->coeffDict().lookup("Q"))), + lisaExp_(readScalar(this->coeffDict().lookup("lisaExp"))), + injectorDirection_(this->coeffDict().lookup("injectorDirection")), + SMDCalcMethod_(this->coeffDict().lookup("SMDCalculationMethod")) { - // NN. Would be good if this could be picked up from the injector + // Note: Would be good if this could be picked up from the injector injectorDirection_ /= mag(injectorDirection_); if (SMDCalcMethod_ == "method1") @@ -57,12 +56,27 @@ Foam::LISAAtomization::LISAAtomization else { SMDMethod_ = method2; - Info << "Warning: SMDCalculationMethod " << SMDCalcMethod_ - << " unknown. Options are ( method1 | method2 ). Using method2" << endl; + Info<< "Warning: SMDCalculationMethod " << SMDCalcMethod_ + << " unknown. Options are (method1 | method2). Using method2" + << endl; } - } +template +Foam::LISAAtomization::LISAAtomization +( + const LISAAtomization& am +) +: + AtomizationModel(am), + Cl_(am.Cl_), + cTau_(am.cTau_), + Q_(am.Q_), + lisaExp_(am.lisaExp_), + injectorDirection_(am.injectorDirection_), + SMDCalcMethod_(am.SMDCalcMethod_) +{} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -79,37 +93,39 @@ Foam::scalar Foam::LISAAtomization::initLiquidCore() const return 1.0; } + template bool Foam::LISAAtomization::calcChi() const { return true; } + template void Foam::LISAAtomization::update ( - const scalar& dt, + const scalar dt, scalar& d, scalar& liquidCore, scalar& tc, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const scalar& massflowRate, - const scalar& rhoAv, - const scalar& Urel, + const scalar rho, + const scalar mu, + const scalar sigma, + const scalar volFlowRate, + const scalar rhoAv, + const scalar Urel, const vector& pos, const vector& injectionPos, - const scalar& pAmbient, - const scalar& chi, - Random& rndGen + const scalar pAmbient, + const scalar chi, + cachedRandom& rndGen ) const { - - if (massflowRate < SMALL) + if (volFlowRate < SMALL) { return; } + scalar tau = 0.0; scalar dL = 0.0; scalar k = 0.0; @@ -117,7 +133,7 @@ void Foam::LISAAtomization::update // update atomization characteristic time tc += dt; - scalar We = 0.5*rhoAv*pow(Urel, 2)*d/sigma; + scalar We = 0.5*rhoAv*sqr(Urel)*d/sigma; scalar nu = mu/rho; scalar Q = rhoAv/rho; @@ -129,121 +145,98 @@ void Foam::LISAAtomization::update scalar h = diff & injectorDirection_; scalar delta = sqrt(sqr(pWalk) - sqr(h)); - scalar hSheet = massflowRate/(mathematicalConstant::pi*delta*rho*Urel); + scalar hSheet = volFlowRate/(constant::mathematical::pi*delta*Urel); // update drop diameter d = min(d, hSheet); - if(We > 27.0/16.0) + if (We > 27.0/16.0) { - scalar kPos = 0.0; - scalar kNeg = Q*pow(Urel, 2.0)*rho/sigma; + scalar kNeg = Q*sqr(Urel)*rho/sigma; - scalar derivativePos = sqrt - ( - Q*pow(Urel, 2.0) - ); + scalar derivPos = sqrt(Q*sqr(Urel)); - scalar derivativeNeg = - ( - 8.0*pow(nu, 2.0)*pow(kNeg, 3.0) - + Q*pow(Urel, 2.0)*kNeg - - 3.0*sigma/2.0/rho*pow(kNeg, 2.0) - ) - / - sqrt - ( - 4.0*pow(nu, 2.0)*pow(kNeg, 4.0) - + Q*pow(Urel, 2.0)*pow(kNeg, 2.0) - - sigma*pow(kNeg, 3.0)/rho - ) - - - 4.0*nu*kNeg; + scalar derivNeg = + ( + 8.0*sqr(nu)*pow3(kNeg) + + Q*sqr(Urel)*kNeg + - 3.0*sigma/2.0/rho*sqr(kNeg) + ) + / sqrt + ( + 4.0*sqr(nu)*pow4(kNeg) + + Q*sqr(Urel)*sqr(kNeg) + - sigma*pow3(kNeg)/rho + ) + - 4.0*nu*kNeg; scalar kOld = 0.0; - for(label i=0; i<40; i++) + for (label i=0; i<40; i++) { + k = kPos - (derivPos/((derivNeg - derivPos)/(kNeg - kPos))); - k = kPos - (derivativePos/((derivativeNeg-derivativePos)/(kNeg-kPos))); + scalar derivk = + ( + 8.0*sqr(nu)*pow3(k) + + Q*sqr(Urel)*k + - 3.0*sigma/2.0/rho*sqr(k) + ) + / sqrt + ( + 4.0*sqr(nu)*pow4(k) + + Q*sqr(Urel)*sqr(k) + - sigma*pow3(k)/rho + ) + - 4.0*nu*k; - scalar derivativek = - ( - 8.0*pow(nu, 2.0)*pow(k, 3.0) - + Q*pow(Urel, 2.0)*k - - 3.0*sigma/2.0/rho*pow(k, 2.0) - ) - / - sqrt - ( - 4.0*pow(nu, 2.0)*pow(k, 4.0) - + Q*pow(Urel, 2.0)*pow(k, 2.0) - - sigma*pow(k, 3.0)/rho - ) - - - 4.0*nu*k; - - if(derivativek > 0) + if (derivk > 0) { - derivativePos = derivativek; + derivPos = derivk; kPos = k; } else { - derivativeNeg = derivativek; + derivNeg = derivk; kNeg = k; } - if(mag(k-kOld)/k < 1e-4) + if (mag(k - kOld)/k < 1e-4) { break; } kOld = k; - } scalar omegaS = - - 2.0 * nu * pow(k, 2.0) - + sqrt - ( - 4.0*pow(nu, 2.0)*pow(k, 4.0) - + Q*pow(Urel, 2.0)*pow(k, 2.0) - - sigma*pow(k, 3.0)/rho - ); + - 2.0*nu*sqr(k) + + sqrt + ( + 4.0*sqr(nu)*pow4(k) + + Q*sqr(Urel)*sqr(k) + - sigma*pow3(k)/rho + ); tau = cTau_/omegaS; dL = sqrt(8.0*d/k); - } else { + k = rhoAv*sqr(Urel)/2.0*sigma; - k = - rhoAv*pow(Urel, 2.0) - / - 2.0*sigma; - - // AL 101011 - //scalar J = pWalk*d/2.0; scalar J = 0.5*traveledTime*hSheet; - tau = pow(3.0*cTau_,2.0/3.0)*cbrt(J*sigma/(sqr(Q)*pow(Urel,4.0)*rho)); + tau = pow(3.0*cTau_, 2.0/3.0)*cbrt(J*sigma/(sqr(Q)*pow4(Urel)*rho)); dL = sqrt(4.0*d/k); } - scalar kL = - 1.0 - / - ( - dL * - pow(0.5 + 1.5 * mu/pow((rho*sigma*dL), 0.5), 0.5) - ); + scalar kL = 1.0/(dL*sqrt(0.5 + 1.5 * mu/sqrt(rho*sigma*dL))); - scalar dD = cbrt(3.0*mathematicalConstant::pi*pow(dL, 2.0)/kL); + scalar dD = cbrt(3.0*constant::mathematical::pi*sqr(dL)/kL); scalar atmPressure = 1.0e+5; @@ -279,9 +272,8 @@ void Foam::LISAAtomization::update liquidCore = 0.0; d = x; tc = 0.0; - } - } + // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.H b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISAAtomization.H similarity index 83% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.H rename to src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISAAtomization.H index 34e6231697..e336ceaafd 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISAAtomization.H +++ b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISAAtomization.H @@ -68,14 +68,15 @@ public: //- Enumeration for SMD calculations enum SMDMethods { - method1, method2 + method1, + method2 }; + private: // Private data - dictionary coeffsDict_; scalar Cl_; scalar cTau_; scalar Q_; @@ -85,6 +86,7 @@ private: SMDMethods SMDMethod_; + public: //- Runtime type information @@ -96,6 +98,18 @@ public: //- Construct from dictionary LISAAtomization(const dictionary&, CloudType&); + //- Construct copy + LISAAtomization(const LISAAtomization& am); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new LISAAtomization(*this) + ); + } + //- Destructor virtual ~LISAAtomization(); @@ -111,23 +125,22 @@ public: virtual void update ( - const scalar& dt, + const scalar dt, scalar& d, scalar& liquidCore, scalar& tc, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const scalar& massflowRate, - const scalar& rhoAv, - const scalar& Urel, + const scalar rho, + const scalar mu, + const scalar sigma, + const scalar volFlowRate, + const scalar rhoAv, + const scalar Urel, const vector& pos, const vector& injectionPos, - const scalar& pAmbient, - const scalar& chi, - Random& rndGen + const scalar pAmbient, + const scalar chi, + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H similarity index 84% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H rename to src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H index 932ec302d9..a153b5a0ca 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H +++ b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod1.H @@ -18,8 +18,8 @@ while(!success) { - x = minValue + range*rndGen.scalar01(); - y = rndGen.scalar01(); + x = minValue + range*rndGen.sample01(); + y = rndGen.sample01(); scalar p = 0.0; scalar nExp = 1; scalar xx = pow(x/dD, nExp); diff --git a/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H new file mode 100644 index 0000000000..42c0dc4e80 --- /dev/null +++ b/src/lagrangian/spray/submodels/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H @@ -0,0 +1,53 @@ +{ + // calculate the new diameter with the standard 1D Rosin Rammler + // distribution. Calculation of the mean radius based on SMR rs. + // Coefficient factorGamma depends on nExp. Note that Reitz either used + // (Schmidt et al., 1999-01-0496) or skipped (Senecal et al.) this factor! + // scalar factorGamma = 0.75*sqrt(mathematicalConstant::pi); //nExp=2 + scalar factorGamma = 1.; + scalar delta = dD/factorGamma; + + // dD is the SMD, and the delta is calculated using gamma + // function. Here we assume nExp = 2 + scalar minValue = dD/10.0; + scalar maxValue = dD; + + // The pdf value for 4.0*delta is already very small. + // scalar maxValue = delta*4.0; + + if (maxValue - minValue < SMALL) + { + minValue = maxValue/20.0; + } + + scalar range = maxValue - minValue; + + scalar nExp = 3; + FixedList rrd; + scalar probFactorMin = exp(-pow(minValue/delta, nExp)); + scalar probFactorMax = exp(-pow(maxValue/delta, nExp)); + scalar probFactor = 1.0/(probFactorMin - probFactorMax); + + forAll(rrd, n) + { + scalar xx = minValue + range*n/500; + rrd[n] = (probFactorMin - exp(-pow(xx/delta, nExp)))*probFactor; + } + + + bool success = false; + + scalar y = rndGen.sample01(); + label k = 0; + + while(!success && (k<500)) + { + if (rrd[k] > y) + { + success = true; + } + k++; + } + + x = minValue + range*(k - 0.5)/500.0; +} diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.C b/src/lagrangian/spray/submodels/AtomizationModel/NoAtomization/NoAtomization.C similarity index 84% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.C rename to src/lagrangian/spray/submodels/AtomizationModel/NoAtomization/NoAtomization.C index fabf8d6fe7..e36c269f06 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.C +++ b/src/lagrangian/spray/submodels/AtomizationModel/NoAtomization/NoAtomization.C @@ -38,6 +38,16 @@ Foam::NoAtomization::NoAtomization {} +template +Foam::NoAtomization::NoAtomization +( + const NoAtomization& am +) +: + AtomizationModel(am) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template @@ -53,32 +63,34 @@ Foam::scalar Foam::NoAtomization::initLiquidCore() const return 0.0; } + template bool Foam::NoAtomization::calcChi() const { return false; } + template void Foam::NoAtomization::update ( - const scalar& dt, + const scalar dt, scalar& d, scalar& liquidCore, scalar& tc, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const scalar& massflowRate, - const scalar& rhoAv, - const scalar& Urel, + const scalar rho, + const scalar mu, + const scalar sigma, + const scalar volFlowRate, + const scalar rhoAv, + const scalar Urel, const vector& pos, const vector& injectionPos, - const scalar& pAmbient, - const scalar& chi, - Random& rndGen + const scalar pAmbient, + const scalar chi, + cachedRandom& rndGen ) const -{ -} +{} + // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.H b/src/lagrangian/spray/submodels/AtomizationModel/NoAtomization/NoAtomization.H similarity index 77% rename from src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.H rename to src/lagrangian/spray/submodels/AtomizationModel/NoAtomization/NoAtomization.H index 08a669822a..7d7d72dd8b 100644 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/NoAtomization/NoAtomization.H +++ b/src/lagrangian/spray/submodels/AtomizationModel/NoAtomization/NoAtomization.H @@ -58,6 +58,18 @@ public: //- Construct from dictionary NoAtomization(const dictionary& dict, CloudType& cloud); + //- Construct copy + NoAtomization(const NoAtomization& am); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new NoAtomization(*this) + ); + } + //- Destructor virtual ~NoAtomization(); @@ -65,31 +77,30 @@ public: // Member Functions - //- initial value of liquidCore + //- Initial value of liquidCore virtual scalar initLiquidCore() const; - //- flag to indicate if chi needs to be calculated + //- Flag to indicate if chi needs to be calculated virtual bool calcChi() const; virtual void update ( - const scalar& dt, + const scalar dt, scalar& d, scalar& liquidCore, scalar& tc, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const scalar& massflowRate, - const scalar& rhoAv, - const scalar& Urel, + const scalar rho, + const scalar mu, + const scalar sigma, + const scalar volFlowRate, + const scalar rhoAv, + const scalar Urel, const vector& pos, const vector& injectionPos, - const scalar& pAmbient, - const scalar& chi, - Random& rndGen + const scalar pAmbient, + const scalar chi, + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.C b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.C similarity index 57% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.C rename to src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.C index ffe0320bbf..8d83605c9b 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.C +++ b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.C @@ -33,9 +33,7 @@ Foam::BreakupModel::BreakupModel CloudType& owner ) : - dict_(dictionary::null), - owner_(owner), - coeffDict_(dictionary::null), + SubModelBase(owner), solveOscillationEq_(false), y0_(0.0), yDot0_(0.0), @@ -45,6 +43,22 @@ Foam::BreakupModel::BreakupModel {} +template +Foam::BreakupModel::BreakupModel +( + const BreakupModel& bum +) +: + SubModelBase(bum), + solveOscillationEq_(bum.solveOscillationEq_), + y0_(bum.y0_), + yDot0_(bum.yDot0_), + TABComega_(bum.TABComega_), + TABCmu_(bum.TABCmu_), + TABWeCrit_(bum.TABWeCrit_) +{} + + template Foam::BreakupModel::BreakupModel ( @@ -53,10 +67,8 @@ Foam::BreakupModel::BreakupModel const word& type ) : - dict_(dict), - owner_(owner), - coeffDict_(dict.subDict(type + "Coeffs")), - solveOscillationEq_(dict_.lookup("solveOscillationEq")), + SubModelBase(owner, dict, type), + solveOscillationEq_(this->coeffDict().lookup("solveOscillationEq")), y0_(0.0), yDot0_(0.0), TABComega_(0.0), @@ -65,7 +77,7 @@ Foam::BreakupModel::BreakupModel { if (solveOscillationEq_) { - dictionary TABcoeffsDict(dict.subDict("TABCoeffs")); + const dictionary TABcoeffsDict(this->coeffDict().subDict("TABCoeffs")); y0_ = readScalar(TABcoeffsDict.lookup("y0")); yDot0_ = readScalar(TABcoeffsDict.lookup("yDot0")); TABComega_ = readScalar(TABcoeffsDict.lookup("Comega")); @@ -83,29 +95,72 @@ Foam::BreakupModel::~BreakupModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -const CloudType& Foam::BreakupModel::owner() const -{ - return owner_; -} - template -const Foam::dictionary& Foam::BreakupModel::dict() const +bool Foam::BreakupModel::update +( + const scalar dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, + const vector& U, + const scalar rhoc, + const scalar muc, + const vector& Urel, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, + scalar& dChild, + scalar& massChild, + cachedRandom& rndGen +) const { - return dict_; + notImplemented + ( + "bool Foam::BreakupModel::update" + "(" + "const scalar, " + "const vector&, " + "scalar&, " + "scalar&, " + "scalar&, " + "scalar&, " + "scalar&, " + "scalar&, " + "scalar&, " + "const scalar, " + "const scalar, " + "const scalar, " + "const scalar, " + "const vector&, " + "const scalar, " + "const scalar, " + "const vector&, " + "const scalar, " + "const scalar, " + "const scalar, " + "scalar&, " + "scalar&, " + "cachedRandom&" + ") const;" + ); + + return false; } -template -const Foam::dictionary& Foam::BreakupModel::coeffDict() const -{ - return coeffDict_; -} - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "NewBreakupModel.C" +#include "BreakupModelNew.C" // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.H b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.H similarity index 75% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.H rename to src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.H index 89ca8cd092..9df5a2eec2 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/BreakupModel.H +++ b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModel.H @@ -25,11 +25,11 @@ Class Foam::BreakupModel Description - Templated phase change model class + Templated break-up model class SourceFiles BreakupModel.C - NewBreakupModel.C + BreakupModelNew.C \*---------------------------------------------------------------------------*/ @@ -46,27 +46,19 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class BreakupModel Declaration + Class BreakupModel Declaration \*---------------------------------------------------------------------------*/ template class BreakupModel +: + public SubModelBase { protected: // Protected data - //- The cloud dictionary - const dictionary& dict_; - - //- Reference to the owner cloud class - CloudType& owner_; - - //- The coefficient dictionary - const dictionary coeffDict_; - - Switch solveOscillationEq_; scalar y0_; @@ -79,7 +71,7 @@ protected: public: //- Runtime type information - TypeName("BreakupModel"); + TypeName("breakupModel"); //- Declare runtime constructor selection table declareRunTimeSelectionTable @@ -108,6 +100,18 @@ public: const word& type ); + //- Construct copy + BreakupModel(const BreakupModel& bum); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new BreakupModel(*this) + ); + } + //- Destructor virtual ~BreakupModel(); @@ -123,15 +127,6 @@ public: // Access - //- Return the owner cloud object - const CloudType& owner() const; - - //- Return the cloud dictionary - const dictionary& dict() const; - - //- Return the coefficient dictionary - const dictionary& coeffDict() const; - inline const Switch& solveOscillationEq() const { return solveOscillationEq_; @@ -162,12 +157,14 @@ public: return TABWeCrit_; } + // Member Functions - //- update the parcel properties and return true if a child parcel should be added + //- Update the parcel properties and return true if a child parcel + // should be added virtual bool update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -176,22 +173,21 @@ public: scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen - ) const = 0; - + cachedRandom& rndGen + ) const; }; @@ -203,27 +199,27 @@ public: #define makeBreakupModel(CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(BreakupModel, 0); \ - \ + typedef CloudType::sprayCloudType sprayCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + BreakupModel, \ + 0 \ + ); \ defineTemplateRunTimeSelectionTable \ ( \ - BreakupModel, \ + BreakupModel, \ dictionary \ ); -#define makeBreakupModelThermoType(SS, CloudType, ParcelType, ThermoType) \ +#define makeBreakupModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ + typedef CloudType::sprayCloudType sprayCloudType; \ + defineNamedTemplateTypeNameAndDebug(SS, 0); \ \ - BreakupModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + BreakupModel:: \ + adddictionaryConstructorToTable > \ + add##SS##CloudType##sprayCloudType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/NewBreakupModel.C b/src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C similarity index 100% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/BreakupModel/NewBreakupModel.C rename to src/lagrangian/spray/submodels/BreakupModel/BreakupModel/BreakupModelNew.C diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.C b/src/lagrangian/spray/submodels/BreakupModel/ETAB/ETAB.C similarity index 71% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.C rename to src/lagrangian/spray/submodels/BreakupModel/ETAB/ETAB.C index c8192b7240..2671a1a4e0 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.C +++ b/src/lagrangian/spray/submodels/BreakupModel/ETAB/ETAB.C @@ -27,7 +27,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template +template Foam::ETAB::ETAB ( const dictionary& dict, @@ -35,32 +35,45 @@ Foam::ETAB::ETAB ) : BreakupModel(dict, owner, typeName), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - Cmu_(readScalar(coeffsDict_.lookup("Cmu"))), - Comega_(readScalar(coeffsDict_.lookup("Comega"))), - k1_(readScalar(coeffsDict_.lookup("k1"))), - k2_(readScalar(coeffsDict_.lookup("k2"))), - WeCrit_(readScalar(coeffsDict_.lookup("WeCrit"))), - WeTransition_(readScalar(coeffsDict_.lookup("WeTransition"))), + Cmu_(readScalar(this->coeffDict().lookup("Cmu"))), + Comega_(readScalar(this->coeffDict().lookup("Comega"))), + k1_(readScalar(this->coeffDict().lookup("k1"))), + k2_(readScalar(this->coeffDict().lookup("k2"))), + WeCrit_(readScalar(this->coeffDict().lookup("WeCrit"))), + WeTransition_(readScalar(this->coeffDict().lookup("WeTransition"))), AWe_(0.0) { scalar k21 = k2_/k1_; - AWe_ = (k21*sqrt(WeTransition_) - 1.0)/pow(WeTransition_, 4.0); + AWe_ = (k21*sqrt(WeTransition_) - 1.0)/pow4(WeTransition_); if (!BreakupModel::solveOscillationEq_) { - Info << "Warning: solveOscillationEq is set to " << BreakupModel::solveOscillationEq_ - << endl - << " Setting it to true in order for the ETAB model to work." << endl; + Info<< "Warning: solveOscillationEq is set to " + << BreakupModel::solveOscillationEq_ << nl + << " Setting it to true in order for the ETAB model to work." + << endl; BreakupModel::solveOscillationEq_ = true; } - } +template +Foam::ETAB::ETAB(const ETAB& bum) +: + BreakupModel(bum), + Cmu_(bum.Cmu_), + Comega_(bum.Comega_), + k1_(bum.k1_), + k2_(bum.k2_), + WeCrit_(bum.WeCrit_), + WeTransition_(bum.WeTransition_), + AWe_(bum.AWe_) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template +template Foam::ETAB::~ETAB() {} @@ -70,7 +83,7 @@ Foam::ETAB::~ETAB() template bool Foam::ETAB::update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -79,27 +92,27 @@ bool Foam::ETAB::update scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const { scalar r = 0.5*d; scalar r2 = r*r; scalar r3 = r*r2; - scalar semiMass = nParticle*pow(d, 3); + scalar semiMass = nParticle*pow3(d); // inverse of characteristic viscous damping time scalar rtd = 0.5*Cmu_*mu/(rho*r2); @@ -112,7 +125,7 @@ bool Foam::ETAB::update scalar omega = sqrt(omega2); scalar romega = 1.0/omega; - scalar We = rhoc*pow(Urmag, 2.0)*r/sigma; + scalar We = rhoc*sqr(Urmag)*r/sigma; scalar Wetmp = We/WeCrit_; scalar y1 = y - Wetmp; @@ -121,7 +134,7 @@ bool Foam::ETAB::update scalar a = sqrt(y1*y1 + y2*y2); // scotty we may have break-up - if (a+Wetmp > 1.0) + if (a + Wetmp > 1.0) { scalar phic = y1/a; @@ -133,7 +146,7 @@ bool Foam::ETAB::update scalar quad = -y2/a; if (quad < 0) { - phi = 2*mathematicalConstant::pi - phit; + phi = 2*constant::mathematical::pi - phit; } scalar tb = 0; @@ -144,13 +157,13 @@ bool Foam::ETAB::update if (theta < phi) { - if (2*mathematicalConstant::pi-theta >= phi) + if (2*constant::mathematical::pi - theta >= phi) { theta = -theta; } - theta += 2*mathematicalConstant::pi; + theta += 2*constant::mathematical::pi; } - tb = (theta-phi)*romega; + tb = (theta - phi)*romega; // breakup occurs if (dt > tb) @@ -163,7 +176,7 @@ bool Foam::ETAB::update // update droplet size if (dt > tb) { - scalar sqrtWe = AWe_*pow(We, 4.0) + 1.0; + scalar sqrtWe = AWe_*pow4(We) + 1.0; scalar Kbr = k1_*omega*sqrtWe; if (We > WeTransition_) @@ -173,7 +186,7 @@ bool Foam::ETAB::update } scalar rWetmp = 1.0/Wetmp; - scalar cosdtbu = max(-1.0, min(1.0, 1.0-rWetmp)); + scalar cosdtbu = max(-1.0, min(1.0, 1.0 - rWetmp)); scalar dtbu = romega*acos(cosdtbu); scalar decay = exp(-Kbr*dtbu); @@ -195,7 +208,7 @@ bool Foam::ETAB::update } // update the nParticle count to conserve mass - nParticle = semiMass/pow(d, 3); + nParticle = semiMass/pow3(d); // Do not add child parcel return false; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.H b/src/lagrangian/spray/submodels/BreakupModel/ETAB/ETAB.H similarity index 77% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.H rename to src/lagrangian/spray/submodels/BreakupModel/ETAB/ETAB.H index adaffe97d7..f37b7da93d 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/ETAB/ETAB.H +++ b/src/lagrangian/spray/submodels/BreakupModel/ETAB/ETAB.H @@ -69,19 +69,18 @@ private: // Private data - dictionary coeffsDict_; + // Model constants - // model constants + // Cmu_ and Comega_ are the same as in the TAB model + scalar Cmu_; + scalar Comega_; - // Cmu_ and Comega_ are the same as in the TAB model - scalar Cmu_; - scalar Comega_; + scalar k1_; + scalar k2_; + scalar WeCrit_; + scalar WeTransition_; + scalar AWe_; - scalar k1_; - scalar k2_; - scalar WeCrit_; - scalar WeTransition_; - scalar AWe_; public: @@ -94,6 +93,18 @@ public: //- Construct from dictionary ETAB(const dictionary&, CloudType&); + //- Construct copy + ETAB(const ETAB& bum); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new ETAB(*this) + ); + } + //- Destructor virtual ~ETAB(); @@ -104,7 +115,7 @@ public: //- update the parcel properties virtual bool update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -113,22 +124,21 @@ public: scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.C b/src/lagrangian/spray/submodels/BreakupModel/NoBreakup/NoBreakup.C similarity index 83% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.C rename to src/lagrangian/spray/submodels/BreakupModel/NoBreakup/NoBreakup.C index f6d570e7eb..7e4d3cf19f 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.C +++ b/src/lagrangian/spray/submodels/BreakupModel/NoBreakup/NoBreakup.C @@ -38,6 +38,14 @@ Foam::NoBreakup::NoBreakup {} + +template +Foam::NoBreakup::NoBreakup(const NoBreakup& bum) +: + BreakupModel(bum) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template @@ -50,7 +58,7 @@ Foam::NoBreakup::~NoBreakup() template bool Foam::NoBreakup::update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -59,20 +67,20 @@ bool Foam::NoBreakup::update scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const { // Do nothing diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.H b/src/lagrangian/spray/submodels/BreakupModel/NoBreakup/NoBreakup.H similarity index 80% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.H rename to src/lagrangian/spray/submodels/BreakupModel/NoBreakup/NoBreakup.H index 3c5f96309b..672a05107c 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/NoBreakup/NoBreakup.H +++ b/src/lagrangian/spray/submodels/BreakupModel/NoBreakup/NoBreakup.H @@ -58,6 +58,18 @@ public: //- Construct from dictionary NoBreakup(const dictionary&, CloudType&); + //- Construct copy + NoBreakup(const NoBreakup& bum); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new NoBreakup(*this) + ); + } + //- Destructor virtual ~NoBreakup(); @@ -68,7 +80,7 @@ public: //- update the parcel properties virtual bool update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -77,22 +89,21 @@ public: scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.C b/src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.C similarity index 77% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.C rename to src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.C index e10c3e2a21..a3a6cdd2f9 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.C +++ b/src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.C @@ -34,17 +34,19 @@ Foam::PilchErdman::PilchErdman CloudType& owner ) : - BreakupModel(dict,owner, typeName), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - B1_(readScalar(coeffsDict_.lookup("B1"))), - B2_(readScalar(coeffsDict_.lookup("B2"))) + BreakupModel(dict, owner, typeName), + B1_(this->coeffDict().template lookupOrDefault("B1", 0.375)), + B2_(this->coeffDict().template lookupOrDefault("B2", 0.236)) {} - /* - These are the default values for this model... - static const scalar B1 = 0.375; - static const scalar B2 = 0.236; - */ + +template +Foam::PilchErdman::PilchErdman(const PilchErdman& bum) +: + BreakupModel(bum), + B1_(bum.B1_), + B2_(bum.B2_) +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -59,7 +61,7 @@ Foam::PilchErdman::~PilchErdman() template bool Foam::PilchErdman::update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -68,34 +70,30 @@ bool Foam::PilchErdman::update scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const { - - scalar semiMass = nParticle*pow(d, 3); - scalar We = 0.5*rhoc*pow(Urmag, 2)*d/sigma; - //scalar nuc = muc/rhoc; - //scalar Re = Urmag*d/nuc; + scalar semiMass = nParticle*pow3(d); + scalar We = 0.5*rhoc*sqr(Urmag)*d/sigma; scalar Oh = mu/pow(rho*d*sigma, 0.5); scalar Wec = 6.0*(1.0 + 1.077*pow(Oh, 1.6)); if (We > Wec) { - // We > 1335, wave crest stripping scalar taubBar = 5.5; @@ -123,9 +121,9 @@ bool Foam::PilchErdman::update scalar rho12 = pow(rhoc/rho, 0.5); scalar Vd = Urmag*rho12*(B1_*taubBar * B2_*taubBar*taubBar); - scalar Vd1 = pow(1.0 - Vd/Urmag, 2.0); + scalar Vd1 = sqr(1.0 - Vd/Urmag); Vd1 = max(Vd1, SMALL); - scalar Ds = 2.0*Wec*sigma*Vd1/(Vd1*rhoc*pow(Urmag, 2.0)); + scalar Ds = 2.0*Wec*sigma*Vd1/(Vd1*rhoc*sqr(Urmag)); scalar A = Urmag*rho12/d; scalar taub = taubBar/A; @@ -136,11 +134,10 @@ bool Foam::PilchErdman::update d = (d + frac*Ds)/(1.0 + frac); // correct the number of particles to conserve mass - nParticle = semiMass/pow(d, 3); + nParticle = semiMass/pow3(d); } return false; - } diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.H b/src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.H similarity index 81% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.H rename to src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.H index 2d62b8823c..6ff144b05c 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/PilchErdman/PilchErdman.H +++ b/src/lagrangian/spray/submodels/BreakupModel/PilchErdman/PilchErdman.H @@ -59,10 +59,10 @@ private: // Private data - dictionary coeffsDict_; scalar B1_; scalar B2_; + public: //- Runtime type information @@ -74,6 +74,18 @@ public: //- Construct from dictionary PilchErdman(const dictionary&, CloudType&); + //- Construct copy + PilchErdman(const PilchErdman& bum); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new PilchErdman(*this) + ); + } + //- Destructor virtual ~PilchErdman(); @@ -84,7 +96,7 @@ public: //- update the parcel properties virtual bool update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -93,22 +105,21 @@ public: scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.C b/src/lagrangian/spray/submodels/BreakupModel/ReitzDiwakar/ReitzDiwakar.C similarity index 65% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.C rename to src/lagrangian/spray/submodels/BreakupModel/ReitzDiwakar/ReitzDiwakar.C index 471499aabe..1ff7327986 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.C +++ b/src/lagrangian/spray/submodels/BreakupModel/ReitzDiwakar/ReitzDiwakar.C @@ -34,21 +34,23 @@ Foam::ReitzDiwakar::ReitzDiwakar CloudType& owner ) : - BreakupModel(dict,owner, typeName), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - Cbag_(readScalar(coeffsDict_.lookup("Cbag"))), - Cb_(readScalar(coeffsDict_.lookup("Cb"))), - Cstrip_(readScalar(coeffsDict_.lookup("Cstrip"))), - Cs_(readScalar(coeffsDict_.lookup("Cs"))) + BreakupModel(dict, owner, typeName), + Cbag_(this->coeffDict().template lookupOrDefault("Cbag", 6.0)), + Cb_(this->coeffDict().template lookupOrDefault("Cb", 0.785)), + Cstrip_(this->coeffDict().template lookupOrDefault("Cstrip", 0.5)), + Cs_(this->coeffDict().template lookupOrDefault("Cs", 10.0)) {} - /* - These are the default values for this model... - static const scalar Cbag = 6.0; - static const scalar Cb = 0.785; - static const scalar Cstrip = 0.5; - static const scalar Cs = 10.0; - */ + +template +Foam::ReitzDiwakar::ReitzDiwakar(const ReitzDiwakar& bum) +: + BreakupModel(bum), + Cbag_(bum.Cbag_), + Cb_(bum.Cb_), + Cstrip_(bum.Cstrip_), + Cs_(bum.Cs_) +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -63,7 +65,7 @@ Foam::ReitzDiwakar::~ReitzDiwakar() template bool Foam::ReitzDiwakar::update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -72,26 +74,25 @@ bool Foam::ReitzDiwakar::update scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const { - scalar d1 = d; scalar nuc = muc/rhoc; - scalar We = 0.5*rhoc*pow(Urmag, 2)*d/sigma; + scalar We = 0.5*rhoc*sqr(Urmag)*d/sigma; scalar Re = Urmag*d/nuc; scalar sqRey = sqrt(Re); @@ -100,11 +101,7 @@ bool Foam::ReitzDiwakar::update { if (We > Cstrip_*sqRey) { - scalar dStrip = pow(2.0*Cstrip_*sigma, 2.0)/ - ( - rhoc*pow(Urmag, 3.0)*muc - ); - + scalar dStrip = sqr(2.0*Cstrip_*sigma)/(rhoc*pow3(Urmag)*muc); scalar tauStrip = Cs_*d*sqrt(rho/rhoc)/Urmag; scalar fraction = dt/tauStrip; @@ -113,18 +110,9 @@ bool Foam::ReitzDiwakar::update } else { - scalar dBag = - 2.0 * Cbag_ * sigma - / ( - rhoc * pow(Urmag, 2.0) - ); + scalar dBag = 2.0*Cbag_*sigma/(rhoc*sqr(Urmag)); - scalar tauBag = - Cb_ * d - * sqrt - ( - rho * d / sigma - ); + scalar tauBag = Cb_*d*sqrt(rho*d/sigma); scalar fraction = dt/tauBag; @@ -132,13 +120,12 @@ bool Foam::ReitzDiwakar::update d = (fraction*dBag + d)/(1.0 + fraction); } - // preserve the total mass/volume, by increasing the number of particles in parcels due to breakup + // preserve the total mass/volume by updating the number of + // particles in parcels due to breakup nParticle *= pow(d1/d, 3.0); - } return false; - } diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.H b/src/lagrangian/spray/submodels/BreakupModel/ReitzDiwakar/ReitzDiwakar.H similarity index 83% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.H rename to src/lagrangian/spray/submodels/BreakupModel/ReitzDiwakar/ReitzDiwakar.H index 7ba86856c0..8d66d47208 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzDiwakar/ReitzDiwakar.H +++ b/src/lagrangian/spray/submodels/BreakupModel/ReitzDiwakar/ReitzDiwakar.H @@ -69,12 +69,12 @@ private: // Private data - dictionary coeffsDict_; scalar Cbag_; scalar Cb_; scalar Cstrip_; scalar Cs_; + public: //- Runtime type information @@ -86,6 +86,18 @@ public: //- Construct from dictionary ReitzDiwakar(const dictionary&, CloudType&); + //- Construct copy + ReitzDiwakar(const ReitzDiwakar& bum); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new ReitzDiwakar(*this) + ); + } + //- Destructor virtual ~ReitzDiwakar(); @@ -96,7 +108,7 @@ public: //- update the parcel properties virtual bool update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -105,22 +117,21 @@ public: scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.C b/src/lagrangian/spray/submodels/BreakupModel/ReitzKHRT/ReitzKHRT.C similarity index 71% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.C rename to src/lagrangian/spray/submodels/BreakupModel/ReitzKHRT/ReitzKHRT.C index f957345532..3c3324ccb0 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.C +++ b/src/lagrangian/spray/submodels/BreakupModel/ReitzKHRT/ReitzKHRT.C @@ -35,13 +35,25 @@ Foam::ReitzKHRT::ReitzKHRT ) : BreakupModel(dict, owner, typeName), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - b0_(readScalar(coeffsDict_.lookup("B0"))), - b1_(readScalar(coeffsDict_.lookup("B1"))), - cTau_(readScalar(coeffsDict_.lookup("Ctau"))), - cRT_(readScalar(coeffsDict_.lookup("CRT"))), - msLimit_(readScalar(coeffsDict_.lookup("msLimit"))), - weberLimit_(readScalar(coeffsDict_.lookup("WeberLimit"))) + b0_(readScalar(this->coeffDict().lookup("B0"))), + b1_(readScalar(this->coeffDict().lookup("B1"))), + cTau_(readScalar(this->coeffDict().lookup("Ctau"))), + cRT_(readScalar(this->coeffDict().lookup("CRT"))), + msLimit_(readScalar(this->coeffDict().lookup("msLimit"))), + weberLimit_(readScalar(this->coeffDict().lookup("WeberLimit"))) +{} + + +template +Foam::ReitzKHRT::ReitzKHRT(const ReitzKHRT& bum) +: + BreakupModel(bum), + b0_(bum.b0_), + b1_(bum.b1_), + cTau_(bum.cTau_), + cRT_(bum.cRT_), + msLimit_(bum.msLimit_), + weberLimit_(bum.weberLimit_) {} @@ -57,7 +69,7 @@ Foam::ReitzKHRT::~ReitzKHRT() template bool Foam::ReitzKHRT::update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -66,38 +78,39 @@ bool Foam::ReitzKHRT::update scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const { bool addParcel = false; scalar r = 0.5*d; - scalar d3 = pow(d, 3.0); - scalar d03 = pow(d0, 3.0); + scalar d3 = pow3(d); + scalar d03 = pow3(d0); - scalar rhopi6 = rho*mathematicalConstant::pi/6.0; + scalar rhopi6 = rho*constant::mathematical::pi/6.0; scalar mass = nParticle*d3*rhopi6; scalar mass0 = nParticle*d03*rhopi6; - scalar weGas = 0.5*rhoc*pow(Urmag, 2)*d/sigma; - scalar weLiquid = 0.5*rho*pow(Urmag, 2)*d/sigma; - // Reitz is using radius instead of diameter for Re-number - scalar reLiquid = rho*Urmag*r/mu; - scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL); - scalar taylor = ohnesorge*sqrt(weGas); + scalar weGas = 0.5*rhoc*sqr(Urmag)*d/sigma; + scalar weLiquid = 0.5*rho*sqr(Urmag)*d/sigma; + + // Note: Reitz is using radius instead of diameter for Re-number + scalar reLiquid = rho*Urmag*r/mu; + scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL); + scalar taylor = ohnesorge*sqrt(weGas); vector acceleration = Urel/tMom; vector trajectory = U/mag(U); @@ -107,7 +120,7 @@ bool Foam::ReitzKHRT::update scalar omegaKH = (0.34 + 0.38*pow(weGas, 1.5)) /((1.0 + ohnesorge)*(1.0 + 1.4*pow(taylor, 0.6))) - *sqrt(sigma/(rho*pow(r, 3.0))); + *sqrt(sigma/(rho*pow3(r))); // corresponding KH wave-length. scalar lambdaKH = @@ -135,7 +148,7 @@ bool Foam::ReitzKHRT::update scalar KRT = sqrt(helpVariable/(3.0*sigma + VSMALL)); // wavelength of the fastest growing RT frequency - scalar lambdaRT = 2.0*mathematicalConstant::pi*cRT_/(KRT + VSMALL); + scalar lambdaRT = 2.0*constant::mathematical::pi*cRT_/(KRT + VSMALL); // if lambdaRT < diameter, then RT waves are growing on the surface // and we start to keep track of how long they have been growing @@ -150,7 +163,7 @@ bool Foam::ReitzKHRT::update scalar tauRT = cTau_/(omegaRT + VSMALL); // check if we have RT breakup - if ((tc > tauRT) && (lambdaRT < d) ) + if ((tc > tauRT) && (lambdaRT < d)) { // the RT breakup creates diameter/lambdaRT new droplets tc = -GREAT; @@ -160,7 +173,6 @@ bool Foam::ReitzKHRT::update // otherwise check for KH breakup else if (dc < d) { - // no breakup below Weber = 12 if (weGas > weberLimit_) { @@ -175,16 +187,18 @@ bool Foam::ReitzKHRT::update if (ms/averageParcelMass > msLimit_) { - - //--------AL_____101201-------------// - // 2. Correct evaluation of the number of child droplets and the diameter of parcel droplets after breaukp - // Solution of cubic equation for the diameter of the parent drops after breakup, see Eq. 18 in Patterson & Reitz, SAE 980131 + // Correct evaluation of the number of child droplets and the + // diameter of parcel droplets after breaukp + // Solution of cubic equation for the diameter of the parent + // drops after breakup, see Eq. 18 in + // Patterson & Reitz, SAE 980131 bool br3 = true; scalar ae3 = 1.; scalar be3 = -dc; scalar ce3 = 0.; scalar de3 = d*d*(dc-d); - scalar qe3 = pow3(be3/(3.0*ae3)) - be3*ce3/(6.0*ae3*ae3) + de3/(2.0*ae3); + scalar qe3 = + pow3(be3/(3.0*ae3)) - be3*ce3/(6.0*ae3*ae3) + de3/(2.0*ae3); scalar pe3 = (3.0*ae3*ce3 - be3*be3)/(9.0*ae3*ae3); scalar D3 = qe3*qe3 + pe3*pe3*pe3; @@ -196,7 +210,7 @@ bool Foam::ReitzKHRT::update scalar ue3 = cbrt(-qe3+D3); scalar ve3 = cbrt(-qe3-D3); scalar dParenDrops = ue3 + ve3 - be3/3.; - scalar mc = nParticle*(pow3(d)-pow3(dParenDrops)); + scalar mc = nParticle*(pow3(d) - pow3(dParenDrops)); scalar nChildDrops = mc/pow3(dc); if (nChildDrops >= nParticle) @@ -209,7 +223,6 @@ bool Foam::ReitzKHRT::update // reduce the parent mass by reducing nParticle mass -= massChild; - } } } @@ -217,11 +230,11 @@ bool Foam::ReitzKHRT::update } else if (KHindex < 0.5) { - //--------AL_____101202-------------// - // 3. Case of larger drops after breakup (Reitz, Atomization & Spray Technology 3 (1987) 309-337, p.322) - // pIndKH() should be introduced + // Case of larger drops after breakup (Reitz, Atomization & Spray + // Technology 3 (1987) 309-337, p.322) pIndKH() should be introduced - scalar lengthScale = min(lambdaKH, 2.0*mathematicalConstant::pi*Urmag/omegaKH); + scalar lengthScale = + min(lambdaKH, 2.0*constant::mathematical::pi*Urmag/omegaKH); scalar diameterLargerDrop = cbrt(1.5*d*d*lengthScale); d = diameterLargerDrop; ms = 0.0; @@ -229,7 +242,7 @@ bool Foam::ReitzKHRT::update } // correct the number of parcels in parent - scalar massDrop = pow(d, 3)*rhopi6; + scalar massDrop = pow3(d)*rhopi6; nParticle = mass/massDrop; return addParcel; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.H b/src/lagrangian/spray/submodels/BreakupModel/ReitzKHRT/ReitzKHRT.H similarity index 81% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.H rename to src/lagrangian/spray/submodels/BreakupModel/ReitzKHRT/ReitzKHRT.H index 86d81eeb1a..464404f573 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/ReitzKHRT/ReitzKHRT.H +++ b/src/lagrangian/spray/submodels/BreakupModel/ReitzKHRT/ReitzKHRT.H @@ -53,8 +53,6 @@ private: // Private data - dictionary coeffsDict_; - // model constants scalar b0_; scalar b1_; @@ -75,6 +73,18 @@ public: //- Construct from dictionary ReitzKHRT(const dictionary&, CloudType&); + //- Construct copy + ReitzKHRT(const ReitzKHRT& bum); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new ReitzKHRT(*this) + ); + } + //- Destructor virtual ~ReitzKHRT(); @@ -85,7 +95,7 @@ public: //- update the parcel diameter virtual bool update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -94,22 +104,21 @@ public: scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/BreakupModel/SHF/SHF.C b/src/lagrangian/spray/submodels/BreakupModel/SHF/SHF.C new file mode 100644 index 0000000000..73dd7cc401 --- /dev/null +++ b/src/lagrangian/spray/submodels/BreakupModel/SHF/SHF.C @@ -0,0 +1,297 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM 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. + + OpenFOAM 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 OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "SHF.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::SHF::SHF +( + const dictionary& dict, + CloudType& owner +) +: + BreakupModel(dict, owner, typeName), + weCorrCoeff_(readScalar(this->coeffDict().lookup("weCorrCoeff"))), + weBuCrit_(readScalar(this->coeffDict().lookup("weBuCrit"))), + weBuBag_(readScalar(this->coeffDict().lookup("weBuBag"))), + weBuMM_(readScalar(this->coeffDict().lookup("weBuMM"))), + ohnCoeffCrit_(readScalar(this->coeffDict().lookup("ohnCoeffCrit"))), + ohnCoeffBag_(readScalar(this->coeffDict().lookup("ohnCoeffBag"))), + ohnCoeffMM_(readScalar(this->coeffDict().lookup("ohnCoeffMM"))), + ohnExpCrit_(readScalar(this->coeffDict().lookup("ohnExpCrit"))), + ohnExpBag_(readScalar(this->coeffDict().lookup("ohnExpBag"))), + ohnExpMM_(readScalar(this->coeffDict().lookup("ohnExpMM"))), + cInit_(readScalar(this->coeffDict().lookup("Cinit"))), + c1_(readScalar(this->coeffDict().lookup("C1"))), + c2_(readScalar(this->coeffDict().lookup("C2"))), + c3_(readScalar(this->coeffDict().lookup("C3"))), + cExp1_(readScalar(this->coeffDict().lookup("Cexp1"))), + cExp2_(readScalar(this->coeffDict().lookup("Cexp2"))), + cExp3_(readScalar(this->coeffDict().lookup("Cexp3"))), + weConst_(readScalar(this->coeffDict().lookup("Weconst"))), + weCrit1_(readScalar(this->coeffDict().lookup("Wecrit1"))), + weCrit2_(readScalar(this->coeffDict().lookup("Wecrit2"))), + coeffD_(readScalar(this->coeffDict().lookup("CoeffD"))), + onExpD_(readScalar(this->coeffDict().lookup("OnExpD"))), + weExpD_(readScalar(this->coeffDict().lookup("WeExpD"))), + mu_(readScalar(this->coeffDict().lookup("mu"))), + sigma_(readScalar(this->coeffDict().lookup("sigma"))), + d32Coeff_(readScalar(this->coeffDict().lookup("d32Coeff"))), + cDmaxBM_(readScalar(this->coeffDict().lookup("cDmaxBM"))), + cDmaxS_(readScalar(this->coeffDict().lookup("cDmaxS"))), + corePerc_(readScalar(this->coeffDict().lookup("corePerc"))) +{} + + +template +Foam::SHF::SHF(const SHF& bum) +: + BreakupModel(bum), + weCorrCoeff_(bum.weCorrCoeff_), + weBuCrit_(bum.weBuCrit_), + weBuBag_(bum.weBuBag_), + weBuMM_(bum.weBuMM_), + ohnCoeffCrit_(bum.ohnCoeffCrit_), + ohnCoeffBag_(bum.ohnCoeffBag_), + ohnCoeffMM_(bum.ohnCoeffMM_), + ohnExpCrit_(bum.ohnExpCrit_), + ohnExpBag_(bum.ohnExpBag_), + ohnExpMM_(bum.ohnExpMM_), + cInit_(bum.cInit_), + c1_(bum.c1_), + c2_(bum.c2_), + c3_(bum.c3_), + cExp1_(bum.cExp1_), + cExp2_(bum.cExp2_), + cExp3_(bum.cExp3_), + weConst_(bum.weConst_), + weCrit1_(bum.weCrit1_), + weCrit2_(bum.weCrit2_), + coeffD_(bum.coeffD_), + onExpD_(bum.onExpD_), + weExpD_(bum.weExpD_), + mu_(bum.mu_), + sigma_(bum.sigma_), + d32Coeff_(bum.d32Coeff_), + cDmaxBM_(bum.cDmaxBM_), + cDmaxS_(bum.cDmaxS_), + corePerc_(bum.corePerc_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::SHF::~SHF() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::SHF::update +( + const scalar dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, + scalar& y, + scalar& yDot, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, + const vector& U, + const scalar rhoc, + const scalar muc, + const vector& Urel, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, + scalar& dChild, + scalar& massChild, + cachedRandom& rndGen +) const +{ + bool addChild = false; + + scalar d03 = pow(d, 3); + scalar rhopi6 = rho*constant::mathematical::pi/6.0; + scalar mass0 = nParticle*rhopi6*d03; + scalar mass = mass0; + + scalar weGas = 0.5*rhoc*sqr(Urmag)*d/sigma; + scalar weLiquid = 0.5*rho*sqr(Urmag)*d/sigma; + + // correct the Reynolds number. Reitz is using radius instead of diameter + scalar reLiquid = 0.5*Urmag*d/mu; + scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL); + + vector acceleration = Urel/tMom; + vector trajectory = U/mag(U); + + scalar weGasCorr = weGas/(1.0 + weCorrCoeff_*ohnesorge); + + // droplet deformation characteristic time + + scalar tChar = d/Urmag*sqrt(rho/rhoc); + + scalar tFirst = cInit_*tChar; + + scalar tSecond = 0; + scalar tCharSecond = 0; + + bool bag = false; + bool multimode = false; + bool shear = false; + bool success = false; + + + // update the droplet characteristic time + tc += dt; + + if (weGas > weConst_) + { + if(weGas < weCrit1_) + { + tCharSecond = c1_*pow((weGas - weConst_), cExp1_); + } + else if(weGas >= weCrit1_ && weGas <= weCrit2_) + { + tCharSecond = c2_*pow((weGas - weConst_), cExp2_); + } + else + { + tCharSecond = c3_*pow((weGas - weConst_), cExp3_); + } + } + + scalar weC = weBuCrit_*(1.0 + ohnCoeffCrit_*pow(ohnesorge, ohnExpCrit_)); + scalar weB = weBuBag_*(1.0 + ohnCoeffBag_*pow(ohnesorge, ohnExpBag_)); + scalar weMM = weBuMM_*(1.0 + ohnCoeffMM_*pow(ohnesorge, ohnExpMM_)); + + if (weGas > weC && weGas < weB) + { + bag = true; + } + + if (weGas >= weB && weGas <= weMM) + { + multimode = true; + } + + if (weGas > weMM) + { + shear = true; + } + + tSecond = tCharSecond*tChar; + + scalar tBreakUP = tFirst + tSecond; + if (tc > tBreakUP) + { + scalar d32 = coeffD_*d*pow(ohnesorge, onExpD_)*pow(weGasCorr, weExpD_); + + if (bag || multimode) + { + scalar d05 = d32Coeff_ * d32; + + scalar x = 0.0; + scalar yGuess = 0.0; + scalar dGuess = 0.0; + + while(!success) + { + x = cDmaxBM_*rndGen.sample01(); + dGuess = sqr(x)*d05; + yGuess = rndGen.sample01(); + + scalar p = + x + /(2.0*sqrt(2.0*constant::mathematical::pi)*sigma_) + *exp(-0.5*sqr((x - mu_)/sigma_)); + + if (yGuess < p) + { + success = true; + } + } + + d = dGuess; + tc = 0.0; + } + + if (shear) + { + scalar dC = weConst_*sigma/(rhoc*sqr(Urmag)); + scalar d32Red = 4.0*(d32*dC)/(5.0*dC - d32); + + scalar d05 = d32Coeff_ * d32Red; + + scalar x = 0.0; + scalar yGuess = 0.0; + scalar dGuess = 0.0; + + while(!success) + { + x = cDmaxS_*rndGen.sample01(); + dGuess = sqr(x)*d05; + yGuess = rndGen.sample01(); + + scalar p = + x + /(2.0*sqrt(2.0*constant::mathematical::pi)*sigma_) + *exp(-0.5*sqr((x - mu_)/sigma_)); + + if (yGuess& bum); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new SHF(*this) + ); + } + //- Destructor virtual ~SHF(); @@ -126,7 +137,7 @@ public: //- update the parcel properties virtual bool update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -135,20 +146,20 @@ public: scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const; }; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.C b/src/lagrangian/spray/submodels/BreakupModel/TAB/TAB.C similarity index 76% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.C rename to src/lagrangian/spray/submodels/BreakupModel/TAB/TAB.C index bed2e72386..0153b6bc5e 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.C +++ b/src/lagrangian/spray/submodels/BreakupModel/TAB/TAB.C @@ -35,28 +35,29 @@ Foam::TAB::TAB ) : BreakupModel(dict, owner, typeName), - coeffsDict_(dict.subDict(typeName + "Coeffs")), Cmu_(BreakupModel::TABCmu_), Comega_(BreakupModel::TABComega_), WeCrit_(BreakupModel::TABWeCrit_), - SMDCalcMethod_(coeffsDict_.lookup("SMDCalculationMethod")) + SMDCalcMethod_(this->coeffDict().lookup("SMDCalculationMethod")) { - // calculate the inverse function of the Rossin-Rammler Distribution const scalar xx0 = 12.0; - const scalar rrd100 = 1.0/(1.0-exp(-xx0)*(1.0+xx0+pow(xx0, 2.0)/2.0 + pow(xx0, 3.0)/6.0)); + const scalar rrd100 = + 1.0/(1.0-exp(-xx0)*(1.0 + xx0 + sqr(xx0)/2.0 + pow3(xx0)/6.0)); - for(label n=0; n<100; n++) + forAll(rrd_, n) { - scalar xx = 0.12*(n+1); - rrd_[n] = (1.0 - exp(-xx)*(1.0 + xx + pow(xx, 2.0)/2.0 + pow(xx, 3.0)/6.0))*rrd100; + scalar xx = 0.12*(n + 1); + rrd_[n] = + (1.0 - exp(-xx)*(1.0 + xx + sqr(xx)/2.0 + pow3(xx)/6.0))*rrd100; } if (!BreakupModel::solveOscillationEq_) { - Info << "Warning: solveOscillationEq is set to " << BreakupModel::solveOscillationEq_ - << endl - << " Setting it to true in order for the TAB model to work." << endl; + Info<< "Warning: solveOscillationEq is set to " + << BreakupModel::solveOscillationEq_ << nl + << " Setting it to true in order for the TAB model to work." + << endl; BreakupModel::solveOscillationEq_ = true; } @@ -71,12 +72,22 @@ Foam::TAB::TAB else { SMDMethod_ = method2; - Info << "Warning: SMDCalculationMethod unknown. Options are ( method1 | method2 ). Using method2" << endl; + Info<< "Warning: SMDCalculationMethod unknown. Options are " + "(method1 | method2). Using method2" << endl; } - } +template +Foam::TAB::TAB(const TAB& bum) +: + BreakupModel(bum), + Cmu_(bum.Cmu_), + Comega_(bum.Comega_), + WeCrit_(bum.WeCrit_), + SMDCalcMethod_(bum.SMDCalcMethod_) +{} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -90,7 +101,7 @@ Foam::TAB::~TAB() template bool Foam::TAB::update ( - const scalar& dt, + const scalar dt, const vector& g, scalar& d, scalar& tc, @@ -99,28 +110,27 @@ bool Foam::TAB::update scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, const vector& U, - const scalar& rhoc, - const scalar& muc, + const scalar rhoc, + const scalar muc, const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, scalar& dChild, scalar& massChild, - Random& rndGen + cachedRandom& rndGen ) const { - scalar r = 0.5*d; scalar r2 = r*r; scalar r3 = r*r2; - scalar semiMass = nParticle*pow(d, 3); + scalar semiMass = nParticle*pow3(d); // inverse of characteristic viscous damping time scalar rtd = 0.5*Cmu_*mu/(rho*r2); @@ -131,7 +141,7 @@ bool Foam::TAB::update if (omega2 > 0) { scalar omega = sqrt(omega2); - scalar We = rhoc*pow(Urmag, 2.0)*r/sigma; + scalar We = rhoc*sqr(Urmag)*r/sigma; scalar Wetmp = We/WeCrit_; scalar y1 = y - Wetmp; @@ -152,7 +162,7 @@ bool Foam::TAB::update scalar quad = -y2/a; if (quad < 0) { - phi = 2*mathematicalConstant::pi - phit; + phi = 2.0*constant::mathematical::pi - phit; } scalar tb = 0; @@ -160,10 +170,7 @@ bool Foam::TAB::update if (mag(y) < 1.0) { scalar coste = 1.0; - if - ( - (Wetmp - a < -1) && (yDot < 0) - ) + if ((Wetmp - a < -1) && (yDot < 0)) { coste = -1.0; } @@ -172,11 +179,11 @@ bool Foam::TAB::update if (theta < phi) { - if (2*mathematicalConstant::pi-theta >= phi) + if (2*constant::mathematical::pi-theta >= phi) { theta = -theta; } - theta += 2*mathematicalConstant::pi; + theta += 2*constant::mathematical::pi; } tb = (theta-phi)/omega; @@ -192,12 +199,8 @@ bool Foam::TAB::update // update droplet size if (dt > tb) { - scalar rs = r/ - ( - 1.0 - + (4.0/3.0)*pow(y, 2) - + rho*r3/(8*sigma)*pow(yDot, 2) - ); + scalar rs = + r/(1.0 + (4.0/3.0)*sqr(y) + rho*r3/(8*sigma)*sqr(yDot)); label n = 0; scalar rNew = 0.0; @@ -221,11 +224,8 @@ bool Foam::TAB::update y = 0; yDot = 0; } - } - } - } else { @@ -235,7 +235,7 @@ bool Foam::TAB::update } // update the nParticle count to conserve mass - nParticle = semiMass/pow(d, 3); + nParticle = semiMass/pow3(d); // Do not add child parcel return false; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.H b/src/lagrangian/spray/submodels/BreakupModel/TAB/TAB.H similarity index 68% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.H rename to src/lagrangian/spray/submodels/BreakupModel/TAB/TAB.H index 420a546b86..9c2664f8ce 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TAB.H +++ b/src/lagrangian/spray/submodels/BreakupModel/TAB/TAB.H @@ -47,6 +47,7 @@ See Also #define TAB_H #include "BreakupModel.H" +#include "FixedList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -62,29 +63,32 @@ class TAB public BreakupModel { public: + //- Enumeration for the SMD brekup calculation enum SMDMethods { - method1, method2 + method1, + method2 }; + private: + // Private data - dictionary coeffsDict_; + // Inverse function approximation of the Rossin-Rammler Distribution + // used when calculating the droplet size after breakup + FixedList rrd_; - // inverse function approximation - // of the Rossin-Rammler Distribution - // used when calculating the droplet size after breakup - scalar rrd_[100]; - // model constants + // Model constants + + scalar Cmu_; + scalar Comega_; + scalar WeCrit_; + word SMDCalcMethod_; + SMDMethods SMDMethod_; - scalar Cmu_; - scalar Comega_; - scalar WeCrit_; - word SMDCalcMethod_; - SMDMethods SMDMethod_; public: @@ -95,7 +99,19 @@ public: // Constructors //- Construct from dictionary - TAB(const dictionary&, CloudType&); + TAB(const dictionary& dict, CloudType& owner); + + //- Construct copy + TAB(const TAB& im); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new TAB(*this) + ); + } //- Destructor @@ -107,31 +123,30 @@ public: //- update the parcel diameter virtual bool update ( - const scalar& dt, - const vector& g, - scalar& d, - scalar& tc, - scalar& ms, - scalar& nParticle, - scalar& KHindex, + const scalar dt, + const vector& g, + scalar& d, + scalar& tc, + scalar& ms, + scalar& nParticle, + scalar& KHindex, scalar& y, scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const vector& U, - const scalar& rhoc, - const scalar& muc, - const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, - scalar& dChild, - scalar& massChild, - Random& rndGen + const scalar d0, + const scalar rho, + const scalar mu, + const scalar sigma, + const vector& U, + const scalar rhoc, + const scalar muc, + const vector& Urel, + const scalar Urmag, + const scalar tMom, + const scalar averageParcelMass, + scalar& dChild, + scalar& massChild, + cachedRandom& rndGen ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod1.H b/src/lagrangian/spray/submodels/BreakupModel/TAB/TABSMDCalcMethod1.H similarity index 79% rename from src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod1.H rename to src/lagrangian/spray/submodels/BreakupModel/TAB/TABSMDCalcMethod1.H index 9aeb6b216f..7c663ab391 100644 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/TAB/TABSMDCalcMethod1.H +++ b/src/lagrangian/spray/submodels/BreakupModel/TAB/TABSMDCalcMethod1.H @@ -1,6 +1,6 @@ { bool found = false; - scalar random = rndGen.scalar01(); + scalar random = rndGen.sample01(); while (!found && (n<99)) { if (rrd_[n]>random) diff --git a/src/lagrangian/spray/submodels/BreakupModel/TAB/TABSMDCalcMethod2.H b/src/lagrangian/spray/submodels/BreakupModel/TAB/TABSMDCalcMethod2.H new file mode 100644 index 0000000000..5d3be05323 --- /dev/null +++ b/src/lagrangian/spray/submodels/BreakupModel/TAB/TABSMDCalcMethod2.H @@ -0,0 +1,46 @@ +{ + // Calculation of the mean radius based on SMR rs. Coefficient + // factorGamma depends on nExp. + scalar factorGamma = 1.; + scalar delta = rs/factorGamma; + + scalar minValue = min(d/2.0, 0.04*rs); + scalar maxValue = rs*4.0; + + scalar range = maxValue - minValue; + + if (maxValue - minValue < SMALL) + { + minValue = d/20.0; + maxValue = d; + } + + scalar nExp = 3.5; + FixedList rrd; + + scalar probFactorMin = exp(-pow(minValue/delta, nExp)); + scalar probFactorMax = exp(-pow(maxValue/delta, nExp)); + scalar probFactor = 1./(probFactorMin - probFactorMax); + + forAll(rrd, n) + { + scalar xx = minValue + range*n/100; + rrd[n] = (probFactorMin - exp(-pow(xx/delta, nExp)))*probFactor; + } + + label n = 0; + bool found = false; + scalar random = rndGen.sample01(); + + while (!found && (n<100)) + { + if (rrd[n] > random) + { + found = true; + } + n++; + + } + + rNew = minValue + range*(n - 0.5)/100.0; +} diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.C b/src/lagrangian/spray/submodels/CollisionModel/CollisionModel/CollisionModel.C similarity index 56% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.C rename to src/lagrangian/spray/submodels/CollisionModel/CollisionModel/CollisionModel.C index 1aafc9af13..0212521e82 100644 --- a/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.C +++ b/src/lagrangian/spray/submodels/CollisionModel/CollisionModel/CollisionModel.C @@ -33,9 +33,17 @@ Foam::CollisionModel::CollisionModel CloudType& owner ) : - dict_(dictionary::null), - owner_(owner), - coeffDict_(dictionary::null) + SubModelBase(owner) +{} + + +template +Foam::CollisionModel::CollisionModel +( + const CollisionModel& cm +) +: + SubModelBase(cm) {} @@ -47,9 +55,7 @@ Foam::CollisionModel::CollisionModel const word& type ) : - dict_(dict), - owner_(owner), - coeffDict_(dict.subDict(type + "Coeffs")) + SubModelBase(owner, dict, type) {} @@ -61,29 +67,74 @@ Foam::CollisionModel::~CollisionModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -const CloudType& Foam::CollisionModel::owner() const -{ - return owner_; -} - template -const Foam::dictionary& Foam::CollisionModel::dict() const +bool Foam::CollisionModel::update +( + const scalar dt, + cachedRandom& rndGen, + vector& pos1, + scalar& m1, + scalar& d1, + scalar& N1, + vector& U1, + scalar& rho1, + scalar& T1, + scalarField& Y1, + const scalar sigma1, + const label celli, + const scalar voli, + vector& pos2, + scalar& m2, + scalar& d2, + scalar& N2, + vector& U2, + scalar& rho2, + scalar& T2, + scalarField& Y2, + const scalar sigma2, + const label cellj, + const scalar volj +) const { - return dict_; + notImplemented + ( + "bool Foam::CollisionModel::update" + "(" + "const scalar, " + "cachedRandom&, " + "vector&, " + "scalar&, " + "scalar&, " + "scalar&, " + "vector&, " + "scalar&, " + "scalar&, " + "scalarField&, " + "const scalar, " + "const label, " + "const scalar, " + "vector&, " + "scalar&, " + "scalar&, " + "scalar&, " + "vector&, " + "scalar&, " + "scalar&, " + "scalarField&, " + "const scalar, " + "const label, " + "const scalar" + ") const" + ); + + return false; } -template -const Foam::dictionary& Foam::CollisionModel::coeffDict() const -{ - return coeffDict_; -} - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "NewCollisionModel.C" +#include "CollisionModelNew.C" // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.H b/src/lagrangian/spray/submodels/CollisionModel/CollisionModel/CollisionModel.H similarity index 76% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.H rename to src/lagrangian/spray/submodels/CollisionModel/CollisionModel/CollisionModel.H index 09c5237a83..4da3046f87 100644 --- a/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/CollisionModel.H +++ b/src/lagrangian/spray/submodels/CollisionModel/CollisionModel/CollisionModel.H @@ -25,11 +25,11 @@ Class Foam::CollisionModel Description - Templated phase change model class + Templated collision model class SourceFiles CollisionModel.C - NewCollisionModel.C + CollisionModelNew.C \*---------------------------------------------------------------------------*/ @@ -39,6 +39,7 @@ SourceFiles #include "IOdictionary.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" +#include "SubModelBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,25 +52,13 @@ namespace Foam template class CollisionModel +: + public SubModelBase { - -protected: - - // Protected data - - //- The cloud dictionary - const dictionary& dict_; - - //- Reference to the owner cloud class - CloudType& owner_; - - //- The coefficient dictionary - const dictionary coeffDict_; - public: //- Runtime type information - TypeName("CollisionModel"); + TypeName("collisionModel"); //- Declare runtime constructor selection table declareRunTimeSelectionTable @@ -98,6 +87,18 @@ public: const word& type ); + //- Construct copy + CollisionModel(const CollisionModel& cm); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new CollisionModel(*this) + ); + } + //- Destructor virtual ~CollisionModel(); @@ -111,26 +112,12 @@ public: ); - // Access - - //- Return the owner cloud object - const CloudType& owner() const; - - //- Return the cloud dictionary - const dictionary& dict() const; - - //- Return the coefficient dictionary - const dictionary& coeffDict() const; - - // Member Functions - virtual bool active() const = 0; - virtual bool update ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -139,7 +126,7 @@ public: scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -150,11 +137,10 @@ public: scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj - ) const = 0; - + ) const; }; @@ -166,26 +152,28 @@ public: #define makeCollisionModel(CloudType) \ \ - defineNamedTemplateTypeNameAndDebug(CollisionModel, 0); \ - \ + typedef CloudType::sprayCloudType sprayCloudType; \ + defineNamedTemplateTypeNameAndDebug \ + ( \ + CollisionModel, \ + 0 \ + ); \ defineTemplateRunTimeSelectionTable \ ( \ - CollisionModel, \ + CollisionModel, \ dictionary \ ); -#define makeCollisionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ + +#define makeCollisionModelType(SS, CloudType) \ \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ + typedef CloudType::sprayCloudType sprayCloudType; \ + defineNamedTemplateTypeNameAndDebug(SS, 0); \ \ - CollisionModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + CollisionModel:: \ + adddictionaryConstructorToTable > \ + add##SS##CloudType##sprayCloudType##ConstructorToTable_; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/NewCollisionModel.C b/src/lagrangian/spray/submodels/CollisionModel/CollisionModel/CollisionModelNew.C similarity index 100% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/CollisionModel/NewCollisionModel.C rename to src/lagrangian/spray/submodels/CollisionModel/CollisionModel/CollisionModelNew.C diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.C b/src/lagrangian/spray/submodels/CollisionModel/NoCollision/NoCollision.C similarity index 89% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.C rename to src/lagrangian/spray/submodels/CollisionModel/NoCollision/NoCollision.C index 373684c5a6..ee8b63bbc3 100644 --- a/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.C +++ b/src/lagrangian/spray/submodels/CollisionModel/NoCollision/NoCollision.C @@ -27,7 +27,7 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template +template Foam::NoCollision::NoCollision ( const dictionary& dict, @@ -38,26 +38,27 @@ Foam::NoCollision::NoCollision {} +template +Foam::NoCollision::NoCollision(const NoCollision& cm) +: + CollisionModel(cm) +{} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -template +template Foam::NoCollision::~NoCollision() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -bool Foam::NoCollision::active() const -{ - return false; -} - template bool Foam::NoCollision::update ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -66,7 +67,7 @@ bool Foam::NoCollision::update scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -77,7 +78,7 @@ bool Foam::NoCollision::update scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const @@ -85,4 +86,5 @@ bool Foam::NoCollision::update return false; } + // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.H b/src/lagrangian/spray/submodels/CollisionModel/NoCollision/NoCollision.H similarity index 84% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.H rename to src/lagrangian/spray/submodels/CollisionModel/NoCollision/NoCollision.H index fcdccfc6d9..10848a294c 100644 --- a/src/lagrangian/spray/submodels/Spray/CollisionModel/NoCollision/NoCollision.H +++ b/src/lagrangian/spray/submodels/CollisionModel/NoCollision/NoCollision.H @@ -56,11 +56,19 @@ public: // Constructors //- Construct from dictionary - NoCollision - ( - const dictionary& dict, - CloudType& cloud - ); + NoCollision(const dictionary& dict, CloudType& cloud); + + //- Construct copy + NoCollision(const NoCollision& cm); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new NoCollision(*this) + ); + } //- Destructor @@ -69,12 +77,10 @@ public: // Member Functions - virtual bool active() const; - virtual bool update ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -83,7 +89,7 @@ public: scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -94,11 +100,10 @@ public: scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.C b/src/lagrangian/spray/submodels/CollisionModel/ORourkeCollision/ORourkeCollision.C similarity index 88% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.C rename to src/lagrangian/spray/submodels/CollisionModel/ORourkeCollision/ORourkeCollision.C index 0bc3a6a19e..6d8a530945 100644 --- a/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.C +++ b/src/lagrangian/spray/submodels/CollisionModel/ORourkeCollision/ORourkeCollision.C @@ -34,9 +34,19 @@ Foam::ORourkeCollision::ORourkeCollision CloudType& owner ) : - CollisionModel(owner), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - coalescence_(coeffsDict_.lookup("coalescence")) + CollisionModel(dict, owner), + coalescence_(this->coeffDict().lookup("coalescence")) +{} + + +template +Foam::ORourkeCollision::ORourkeCollision +( + const ORourkeCollision& cm +) +: + CollisionModel(cm), + coalescence_(cm.coalescence_) {} @@ -49,17 +59,11 @@ Foam::ORourkeCollision::~ORourkeCollision() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -bool Foam::ORourkeCollision::active() const -{ - return true; -} - template bool Foam::ORourkeCollision::update ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -68,7 +72,7 @@ bool Foam::ORourkeCollision::update scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -79,7 +83,7 @@ bool Foam::ORourkeCollision::update scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const @@ -89,20 +93,20 @@ bool Foam::ORourkeCollision::update { return false; } + bool coalescence = false; scalar magVrel = mag(U1-U2); scalar sumD = d1 + d2; - scalar nu0 = 0.25*mathematicalConstant::pi*sumD*sumD*magVrel*dt/volj; + scalar nu0 = 0.25*constant::mathematical::pi*sumD*sumD*magVrel*dt/volj; scalar nMin = min(N1, N2); scalar nu = nMin*nu0; scalar collProb = exp(-nu); - scalar xx = rndGen.scalar01(); + scalar xx = rndGen.sample01(); - // collision occur - if ( xx > collProb) + // collision occurs + if (xx > collProb) { - if (d1 > d2) { coalescence = collideSorted @@ -171,8 +175,8 @@ bool Foam::ORourkeCollision::update template bool Foam::ORourkeCollision::collideSorted ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -181,7 +185,7 @@ bool Foam::ORourkeCollision::collideSorted scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -192,7 +196,7 @@ bool Foam::ORourkeCollision::collideSorted scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const @@ -227,10 +231,10 @@ bool Foam::ORourkeCollision::collideSorted scalar coalesceProb = min(1.0, 2.4*f/WeColl); - scalar prob = rndGen.scalar01(); + scalar prob = rndGen.sample01(); // Coalescence - if ( prob < coalesceProb && coalescence_) + if (prob < coalesceProb && coalescence_) { coalescence = true; // How 'many' of the droplets coalesce @@ -240,7 +244,7 @@ bool Foam::ORourkeCollision::collideSorted scalar m2Org = m2; scalar dm = N1*nProb*mdMin; m2 -= dm; - scalar V2 = mathematicalConstant::pi*pow(d2, 3.0)/6.0; + scalar V2 = constant::mathematical::pi*pow3(d2)/6.0; N2 = m2/(rho2*V2); scalar m1Org = m1; @@ -251,7 +255,6 @@ bool Foam::ORourkeCollision::collideSorted // update the liquid mass fractions Y1 = (m1Org*Y1 + dm*Y2)/m1; - } // Grazing collision (no coalescence) else @@ -286,9 +289,10 @@ bool Foam::ORourkeCollision::collideSorted U2 = v2p; } - } // if - coalescence or not + } return coalescence; } + // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.H b/src/lagrangian/spray/submodels/CollisionModel/ORourkeCollision/ORourkeCollision.H similarity index 84% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.H rename to src/lagrangian/spray/submodels/CollisionModel/ORourkeCollision/ORourkeCollision.H index bbb968f04a..54c94d57f1 100644 --- a/src/lagrangian/spray/submodels/Spray/CollisionModel/ORourkeCollision/ORourkeCollision.H +++ b/src/lagrangian/spray/submodels/CollisionModel/ORourkeCollision/ORourkeCollision.H @@ -62,11 +62,19 @@ public: // Constructors //- Construct from dictionary - ORourkeCollision - ( - const dictionary& dict, - CloudType& cloud - ); + ORourkeCollision(const dictionary& dict, CloudType& cloud); + + //- Construct copy + ORourkeCollision(const ORourkeCollision& cm); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new ORourkeCollision(*this) + ); + } //- Destructor @@ -75,12 +83,10 @@ public: // Member Functions - virtual bool active() const; - virtual bool update ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -89,7 +95,7 @@ public: scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -100,7 +106,7 @@ public: scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const; @@ -109,8 +115,8 @@ public: // 1 is the larger drop and 2 is the smaller bool collideSorted ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -119,7 +125,7 @@ public: scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -130,11 +136,10 @@ public: scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.C b/src/lagrangian/spray/submodels/CollisionModel/TrajectoryCollision/TrajectoryCollision.C similarity index 89% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.C rename to src/lagrangian/spray/submodels/CollisionModel/TrajectoryCollision/TrajectoryCollision.C index 3acb1dd07c..9c90acc7fb 100644 --- a/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.C +++ b/src/lagrangian/spray/submodels/CollisionModel/TrajectoryCollision/TrajectoryCollision.C @@ -34,11 +34,23 @@ Foam::TrajectoryCollision::TrajectoryCollision CloudType& owner ) : - CollisionModel(owner), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - cSpace_(readScalar(coeffsDict_.lookup("cSpace"))), - cTime_(readScalar(coeffsDict_.lookup("cTime"))), - coalescence_(coeffsDict_.lookup("coalescence")) + CollisionModel(dict, owner, typeName), + cSpace_(readScalar(this->coeffDict().lookup("cSpace"))), + cTime_(readScalar(this->coeffDict().lookup("cTime"))), + coalescence_(this->coeffDict().lookup("coalescence")) +{} + + +template +Foam::TrajectoryCollision::TrajectoryCollision +( + const TrajectoryCollision& cm +) +: + CollisionModel(cm), + cSpace_(cm.cSpace_), + cTime_(cm.cTime_), + coalescence_(cm.coalescence_) {} @@ -51,17 +63,11 @@ Foam::TrajectoryCollision::~TrajectoryCollision() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -bool Foam::TrajectoryCollision::active() const -{ - return true; -} - template bool Foam::TrajectoryCollision::update ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -70,7 +76,7 @@ bool Foam::TrajectoryCollision::update scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -81,7 +87,7 @@ bool Foam::TrajectoryCollision::update scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const @@ -89,12 +95,11 @@ bool Foam::TrajectoryCollision::update bool coalescence = false; vector vRel = U1 - U2; - // scalar magVRel = mag(vRel); vector p = pos2 - pos1; scalar dist = mag(p); - scalar vAlign = vRel & (p/(dist+SMALL)); + scalar vAlign = vRel & (p/(dist + SMALL)); if (vAlign > 0) { @@ -137,7 +142,7 @@ bool Foam::TrajectoryCollision::update pow(0.5*sumD/max(0.5*sumD, closestDist), cSpace_) * exp(-cTime_*mag(alpha-beta)); - scalar xx = rndGen.scalar01(); + scalar xx = rndGen.sample01(); // collision occur if ((xx < collProb) && (m1 > VSMALL) && (m2 > VSMALL)) @@ -202,12 +207,9 @@ bool Foam::TrajectoryCollision::update voli ); } - } // if ( d1 > d2 ) - - } // if - possible collision (alpha, beta) in timeinterval - - } // if - travelled distance is larger distance between parcels - + } + } + } } return coalescence; @@ -217,8 +219,8 @@ bool Foam::TrajectoryCollision::update template bool Foam::TrajectoryCollision::collideSorted ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -227,7 +229,7 @@ bool Foam::TrajectoryCollision::collideSorted scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -238,7 +240,7 @@ bool Foam::TrajectoryCollision::collideSorted scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const @@ -276,7 +278,7 @@ bool Foam::TrajectoryCollision::collideSorted scalar coalesceProb = min(1.0, 2.4*f/WeColl); - scalar prob = rndGen.scalar01(); + scalar prob = rndGen.sample01(); // Coalescence if ( prob < coalesceProb && coalescence_) @@ -289,7 +291,7 @@ bool Foam::TrajectoryCollision::collideSorted scalar m2Org = m2; scalar dm = N1*nProb*mdMin; m2 -= dm; - scalar V2 = mathematicalConstant::pi*pow(d2, 3.0)/6.0; + scalar V2 = constant::mathematical::pi*pow3(d2)/6.0; N2 = m2/(rho2*V2); scalar m1Org = m1; @@ -300,7 +302,6 @@ bool Foam::TrajectoryCollision::collideSorted // update the liquid mass fractions Y1 = (m1Org*Y1 + dm*Y2)/m1; - } // Grazing collision (no coalescence) else @@ -333,10 +334,10 @@ bool Foam::TrajectoryCollision::collideSorted U1 = (N2*v1p + (N1-N2)*U1)/N1; U2 = v2p; } - - } // if - coalescence or not + } return coalescence; } + // ************************************************************************* // diff --git a/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.H b/src/lagrangian/spray/submodels/CollisionModel/TrajectoryCollision/TrajectoryCollision.H similarity index 83% rename from src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.H rename to src/lagrangian/spray/submodels/CollisionModel/TrajectoryCollision/TrajectoryCollision.H index 092c65b2a3..e0e4dc2243 100644 --- a/src/lagrangian/spray/submodels/Spray/CollisionModel/TrajectoryCollision/TrajectoryCollision.H +++ b/src/lagrangian/spray/submodels/CollisionModel/TrajectoryCollision/TrajectoryCollision.H @@ -48,26 +48,36 @@ class TrajectoryCollision public CollisionModel { private: - // Reference to the coefficients dictionary - dictionary coeffsDict_; + + // Private data scalar cSpace_; scalar cTime_; Switch coalescence_; + + public: //- Runtime type information - TypeName("Trajectory"); + TypeName("trajectory"); // Constructors //- Construct from dictionary - TrajectoryCollision - ( - const dictionary& dict, - CloudType& cloud - ); + TrajectoryCollision(const dictionary& dict, CloudType& cloud); + + //- Construct copy + TrajectoryCollision(const TrajectoryCollision& cm); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new TrajectoryCollision(*this) + ); + } //- Destructor @@ -76,12 +86,10 @@ public: // Member Functions - virtual bool active() const; - virtual bool update ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -90,7 +98,7 @@ public: scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -101,7 +109,7 @@ public: scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const; @@ -109,8 +117,8 @@ public: // 1 is the larger drop and 2 is the smaller bool collideSorted ( - const scalar& dt, - Random& rndGen, + const scalar dt, + cachedRandom& rndGen, vector& pos1, scalar& m1, scalar& d1, @@ -119,7 +127,7 @@ public: scalar& rho1, scalar& T1, scalarField& Y1, - const scalar& sigma1, + const scalar sigma1, const label celli, const scalar voli, vector& pos2, @@ -130,11 +138,10 @@ public: scalar& rho2, scalar& T2, scalarField& Y2, - const scalar& sigma2, + const scalar sigma2, const label cellj, const scalar volj ) const; - }; diff --git a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H b/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H deleted file mode 100644 index bc3aa5d949..0000000000 --- a/src/lagrangian/spray/submodels/Spray/AtomizationModel/LISAAtomization/LISASMDCalcMethod2.H +++ /dev/null @@ -1,71 +0,0 @@ -{ - - // calculate the new diameter with the standard 1D Rosin Rammler distribution - //-------------AL_____101012---------------------------// - // Calculation of the mean radius based on SMR rs. Coefficient factorGamma depends on nExp. - // Note that Reitz either used (Schmidt et al., 1999-01-0496) or skipped (Senecal et al.) this factor!!! - // scalar factorGamma = 0.75*sqrt(mathematicalConstant::pi); //nExp=2 - scalar factorGamma = 1.; - scalar delta = dD/factorGamma; - - /* dD is the SMD, and the delta is calculated using gama - function. Here we assume nExp = 2. */ - // scalar delta = dD/(0.75*sqrt(mathematicalConstant::pi)); - - // scalar minValue = min(p.d()/20.0,dD/20.0); - scalar minValue = dD/10.0; - - // delta is divided by 20 instead of 10 in order to make sure of small minValue - // scalar minValue = min(p.d(),dD/20.0); - - // scalar maxValue = p.d(); - scalar maxValue = dD; - - // The pdf value for 4.0*delta is already very small. - // scalar maxValue = delta*4.0; - - if(maxValue - minValue < SMALL) - { - // minValue = p.d()/20.0; - minValue = maxValue/20.0; - //-----------------------------------END-------------------------------------// - } - - scalar range = maxValue - minValue; - - scalar nExp = 3; - scalar rrd[500]; - //--------------------------------AL_____101012------------------------------// - scalar probFactorMin = exp(-pow(minValue/delta,nExp)); - scalar probFactorMax = exp(-pow(maxValue/delta,nExp)); - scalar probFactor = 1./(probFactorMin - probFactorMax); - //-----------------------------------END-------------------------------------// - for(label n=0; n<500; n++) - { - scalar xx = minValue + range*n/500; - //-------------------------------AL_____101012-------------------------------// - // rrd_[n] = 1 - exp(-pow(xx/delta,nExp)); - rrd[n] = (probFactorMin - exp(-pow(xx/delta,nExp)))*probFactor; - //-----------------------------------END-------------------------------------// - } - - - bool success = false; - - scalar y = rndGen.scalar01(); - label k = 0; - - while(!success && (k<500)) - { - if (rrd[k]>y) - { - success = true; - } - k++; - - } - //--------------------------------AL_____101012------------------------------// - // x = minValue + range*n/500; - x = minValue + range*(k-0.5)/500.0; - //------------------------------------END------------------------------------// -} diff --git a/src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.C b/src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.C deleted file mode 100644 index a5de5e74ca..0000000000 --- a/src/lagrangian/spray/submodels/Spray/BreakupModel/SHF/SHF.C +++ /dev/null @@ -1,259 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM 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. - - OpenFOAM 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 OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "SHF.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::SHF::SHF -( - const dictionary& dict, - CloudType& owner -) -: - BreakupModel(dict, owner, typeName), - coeffsDict_(dict.subDict(typeName + "Coeffs")), - weCorrCoeff_(readScalar(coeffsDict_.lookup("weCorrCoeff"))), - weBuCrit_(readScalar(coeffsDict_.lookup("weBuCrit"))), - weBuBag_(readScalar(coeffsDict_.lookup("weBuBag"))), - weBuMM_(readScalar(coeffsDict_.lookup("weBuMM"))), - ohnCoeffCrit_(readScalar(coeffsDict_.lookup("ohnCoeffCrit"))), - ohnCoeffBag_(readScalar(coeffsDict_.lookup("ohnCoeffBag"))), - ohnCoeffMM_(readScalar(coeffsDict_.lookup("ohnCoeffMM"))), - ohnExpCrit_(readScalar(coeffsDict_.lookup("ohnExpCrit"))), - ohnExpBag_(readScalar(coeffsDict_.lookup("ohnExpBag"))), - ohnExpMM_(readScalar(coeffsDict_.lookup("ohnExpMM"))), - cInit_(readScalar(coeffsDict_.lookup("Cinit"))), - c1_(readScalar(coeffsDict_.lookup("C1"))), - c2_(readScalar(coeffsDict_.lookup("C2"))), - c3_(readScalar(coeffsDict_.lookup("C3"))), - cExp1_(readScalar(coeffsDict_.lookup("Cexp1"))), - cExp2_(readScalar(coeffsDict_.lookup("Cexp2"))), - cExp3_(readScalar(coeffsDict_.lookup("Cexp3"))), - weConst_(readScalar(coeffsDict_.lookup("Weconst"))), - weCrit1_(readScalar(coeffsDict_.lookup("Wecrit1"))), - weCrit2_(readScalar(coeffsDict_.lookup("Wecrit2"))), - coeffD_(readScalar(coeffsDict_.lookup("CoeffD"))), - onExpD_(readScalar(coeffsDict_.lookup("OnExpD"))), - weExpD_(readScalar(coeffsDict_.lookup("WeExpD"))), - mu_(readScalar(coeffsDict_.lookup("mu"))), - sigma_(readScalar(coeffsDict_.lookup("sigma"))), - d32Coeff_(readScalar(coeffsDict_.lookup("d32Coeff"))), - cDmaxBM_(readScalar(coeffsDict_.lookup("cDmaxBM"))), - cDmaxS_(readScalar(coeffsDict_.lookup("cDmaxS"))), - corePerc_(readScalar(coeffsDict_.lookup("corePerc"))) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::SHF::~SHF() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -bool Foam::SHF::update -( - const scalar& dt, - const vector& g, - scalar& d, - scalar& tc, - scalar& ms, - scalar& nParticle, - scalar& KHindex, - scalar& y, - scalar& yDot, - const scalar& d0, - const scalar& rho, - const scalar& mu, - const scalar& sigma, - const vector& U, - const scalar& rhoc, - const scalar& muc, - const vector& Urel, - const scalar& Urmag, - const scalar& tMom, - const scalar& averageParcelMass, - scalar& dChild, - scalar& massChild, - Random& rndGen -) const -{ - bool addChild = false; - - scalar d03 = pow(d, 3); - scalar rhopi6 = rho*mathematicalConstant::pi/6.0; - scalar mass0 = nParticle*rhopi6*d03; - scalar mass = mass0; - - scalar weGas = 0.5*rhoc*pow(Urmag, 2.0)*d/sigma; - scalar weLiquid = 0.5*rho*pow(Urmag, 2.0)*d/sigma; - - // correct the Reynolds number. Reitz is using radius instead of diameter - scalar reLiquid = 0.5*Urmag*d/mu; - scalar ohnesorge = sqrt(weLiquid)/(reLiquid + VSMALL); - - vector acceleration = Urel/tMom; - vector trajectory = U/mag(U); - - scalar weGasCorr = weGas/(1.0 + weCorrCoeff_ * ohnesorge); - - // droplet deformation characteristic time - - scalar tChar = d/Urmag*sqrt(rho/rhoc); - - scalar tFirst = cInit_ * tChar; - - scalar tSecond = 0; - scalar tCharSecond = 0; - - bool bag = false; - bool multimode = false; - bool shear = false; - bool success = false; - - - // updating the droplet characteristic time - tc += dt; - - if(weGas > weConst_) - { - if(weGas < weCrit1_) - { - tCharSecond = c1_*pow((weGas - weConst_),cExp1_); - } - else if(weGas >= weCrit1_ && weGas <= weCrit2_) - { - tCharSecond = c2_*pow((weGas - weConst_),cExp2_); - } - else - { - tCharSecond = c3_*pow((weGas - weConst_),cExp3_); - } - } - - scalar weC = weBuCrit_*(1.0+ohnCoeffCrit_*pow(ohnesorge,ohnExpCrit_)); - scalar weB = weBuBag_*(1.0+ohnCoeffBag_*pow(ohnesorge, ohnExpBag_)); - scalar weMM = weBuMM_*(1.0+ohnCoeffMM_*pow(ohnesorge, ohnExpMM_)); - - if(weGas > weC && weGas < weB) - { - bag = true; - } - - if(weGas >= weB && weGas <= weMM) - { - multimode = true; - } - - if(weGas > weMM) - { - shear = true; - } - - tSecond = tCharSecond * tChar; - - scalar tBreakUP = tFirst + tSecond; - if(tc > tBreakUP) - { - - scalar d32 = coeffD_*d*pow(ohnesorge,onExpD_)*pow(weGasCorr,weExpD_); - - if(bag || multimode) - { - - scalar d05 = d32Coeff_ * d32; - - scalar x = 0.0; - scalar yGuess = 0.0; - scalar dGuess = 0.0; - - while(!success) - { - x = cDmaxBM_*rndGen.scalar01(); - dGuess = sqr(x)*d05; - yGuess = rndGen.scalar01(); - - scalar p = x/(2.0*sqrt(2.0*mathematicalConstant::pi)*sigma_)*exp(-0.5*sqr((x-mu_)/sigma_)); - - if (yGuess < p) - { - success = true; - } - } - - d = dGuess; - tc = 0.0; - } - - if(shear) - { - scalar dC = weConst_*sigma/(rhoc*sqr(Urmag)); - scalar d32Red = 4.0*(d32 * dC)/(5.0 * dC - d32); - - scalar d05 = d32Coeff_ * d32Red; - - scalar x = 0.0; - scalar yGuess = 0.0; - scalar dGuess = 0.0; - - while(!success) - { - - x = cDmaxS_*rndGen.scalar01(); - dGuess = sqr(x)*d05; - yGuess = rndGen.scalar01(); - - scalar p = x/(2.0*sqrt(2.0*mathematicalConstant::pi)*sigma_)*exp(-0.5*sqr((x-mu_)/sigma_)); - - if (yGuessrandom) - { - found = true; - } - n++; - - } - //--------------------------------AL_____101012------------------------------// - // rNew = minValue + range*n/100; - rNew = minValue + range*(n-0.5)/100.0; - //------------------------------------END------------------------------------// - -} From f206f572c92b86a1e02823f50499dd829fed1615 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 23 May 2011 16:05:56 +0100 Subject: [PATCH 14/79] ENH: ReleaseNotes-dev --- ReleaseNotes-dev | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev index 5f25edc276..60ae48071f 100644 --- a/ReleaseNotes-dev +++ b/ReleaseNotes-dev @@ -241,9 +241,11 @@ - works in parallel + =snappyHexMesh=: + extrude across multi-processor boundaries - + preserve faceZones during layering - + combining patch faces after snapping + + preserve faceZones shape during layering + + combining coincident patch faces is now default after snapping + *Warning*: + - snapControls::tolerance setting fixed w.r.t. 17x. Is the + multiplication to calculate the local search distance for nearest. - minMedianAxisAngle angle fixed w.r.t. 17x. Set to 90 to get same behaviour as 130 in 17x. - nGrow did not work in 17x. Set to 0 @@ -308,6 +310,8 @@ + multipleBoxes, hotBoxes, panel, evaporationTest + =interDyMFoam= tutorials: + testTubeMixer: showcases =solidBodyMotionFunction= + + =snappyHexMesh= tutorials: + + flange: demonstration of feature lines in snappyHexMesh * Other + compilable with =clang= From 2ecef2c7b95686b63294755399be878fa1526897 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 23 May 2011 16:07:00 +0100 Subject: [PATCH 15/79] BUG: globalPoints: handling shared points on V-cyclics --- .../polyMesh/globalMeshData/globalPoints.C | 131 +++++++++--------- 1 file changed, 67 insertions(+), 64 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C index 9a1954c507..0b12acd728 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C @@ -613,80 +613,83 @@ void Foam::globalPoints::receivePatchPoints label meshPointA = meshPoints[i]; label meshPointB = coupledMeshPoints[i]; - //Pout<< "Connection between point " << meshPointA - // << " at " << mesh_.points()[meshPointA] - // << " and " << meshPointB - // << " at " << mesh_.points()[meshPointB] << endl; - - label localA = meshToLocalPoint - ( - meshToPatchPoint, - meshPointA - ); - label localB = meshToLocalPoint - ( - meshToPatchPoint, - meshPointB - ); - - - // Do we have information on pointA? - Map