diff --git a/applications/solvers/molecularDynamics/gnemdFoam/Make/options b/applications/solvers/molecularDynamics/gnemdFoam/Make/options index 80f9773456..89431d0625 100755 --- a/applications/solvers/molecularDynamics/gnemdFoam/Make/options +++ b/applications/solvers/molecularDynamics/gnemdFoam/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ - -I$(LIB_SRC)/lagrangian/molecule/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude @@ -8,4 +9,5 @@ EXE_LIBS = \ -lmeshTools \ -lfiniteVolume \ -llagrangian \ - -lmolecule + -lmolecule \ + -lpotential diff --git a/applications/solvers/molecularDynamics/gnemdFoam/gnemdFoam.C b/applications/solvers/molecularDynamics/gnemdFoam/gnemdFoam.C old mode 100755 new mode 100644 diff --git a/applications/solvers/molecularDynamics/mdEquilibrationFoam/Make/options b/applications/solvers/molecularDynamics/mdEquilibrationFoam/Make/options index 80f9773456..89431d0625 100755 --- a/applications/solvers/molecularDynamics/mdEquilibrationFoam/Make/options +++ b/applications/solvers/molecularDynamics/mdEquilibrationFoam/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ - -I$(LIB_SRC)/lagrangian/molecule/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude @@ -8,4 +9,5 @@ EXE_LIBS = \ -lmeshTools \ -lfiniteVolume \ -llagrangian \ - -lmolecule + -lmolecule \ + -lpotential diff --git a/applications/solvers/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C b/applications/solvers/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C old mode 100755 new mode 100644 diff --git a/applications/solvers/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H b/applications/solvers/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H old mode 100755 new mode 100644 diff --git a/applications/utilities/mesh/manipulation/setSet/.setSet b/applications/utilities/mesh/manipulation/setSet/.setSet deleted file mode 100644 index ff604669be..0000000000 --- a/applications/utilities/mesh/manipulation/setSet/.setSet +++ /dev/null @@ -1 +0,0 @@ -quit diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index c4e6b21162..4790e0ffc2 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -405,64 +405,71 @@ bool doCommand backup(mesh, setName, currentSet, setName + "_old"); } - if (action == topoSetSource::CLEAR) + switch (action) { - // Already handled above by not reading - } - else if (action == topoSetSource::INVERT) - { - currentSet.invert(currentSet.maxSize(mesh)); - } - else if (action == topoSetSource::LIST) - { - currentSet.writeDebug(Pout, mesh, 100); - Pout<< endl; - } - else if (action == topoSetSource::SUBSET) - { - if (is >> sourceType) + case topoSetSource::CLEAR: { - autoPtr setSource - ( - topoSetSource::New - ( - sourceType, - mesh, - is - ) - ); - - // Backup current set. - topoSet oldSet - ( - mesh, - currentSet.name() + "_old2", - currentSet - ); - - currentSet.clear(); - currentSet.resize(oldSet.size()); - setSource().applyToSet(topoSetSource::NEW, currentSet); - - // Combine new value of currentSet with old one. - currentSet.subset(oldSet); + // Already handled above by not reading + break; } - } - else - { - if (is >> sourceType) + case topoSetSource::INVERT: { - autoPtr setSource - ( - topoSetSource::New + currentSet.invert(currentSet.maxSize(mesh)); + break; + } + case topoSetSource::LIST: + { + currentSet.writeDebug(Pout, mesh, 100); + Pout<< endl; + break; + } + case topoSetSource::SUBSET: + { + if (is >> sourceType) + { + autoPtr setSource ( - sourceType, - mesh, - is - ) - ); + topoSetSource::New + ( + sourceType, + mesh, + is + ) + ); - setSource().applyToSet(action, currentSet); + // Backup current set. + topoSet oldSet + ( + mesh, + currentSet.name() + "_old2", + currentSet + ); + + currentSet.clear(); + currentSet.resize(oldSet.size()); + setSource().applyToSet(topoSetSource::NEW, currentSet); + + // Combine new value of currentSet with old one. + currentSet.subset(oldSet); + } + break; + } + default: + { + if (is >> sourceType) + { + autoPtr setSource + ( + topoSetSource::New + ( + sourceType, + mesh, + is + ) + ); + + setSource().applyToSet(action, currentSet); + } } } @@ -532,7 +539,7 @@ bool doCommand } } - return error; + return !error; } @@ -612,31 +619,36 @@ commandStatus parseType switch(stat) { case polyMesh::UNCHANGED: + { Pout<< " mesh not changed." << endl; - break; - + break; + } case polyMesh::POINTS_MOVED: + { Pout<< " points moved; topology unchanged." << endl; - break; - + break; + } case polyMesh::TOPO_CHANGE: + { Pout<< " topology changed; patches unchanged." << nl << " "; printMesh(runTime, mesh); - - break; - + break; + } case polyMesh::TOPO_PATCH_CHANGE: + { Pout<< " topology changed and patches changed." << nl << " "; printMesh(runTime, mesh); - break; - + break; + } default: + { FatalErrorIn("parseType") << "Illegal mesh update state " << stat << abort(FatalError); - break; + break; + } } return INVALID; diff --git a/applications/utilities/miscellaneous/patchSummary/Make/files b/applications/utilities/miscellaneous/patchSummary/Make/files new file mode 100644 index 0000000000..62485dc33d --- /dev/null +++ b/applications/utilities/miscellaneous/patchSummary/Make/files @@ -0,0 +1,3 @@ +patchSummary.C + +EXE = $(FOAM_USER_APPBIN)/patchSummary diff --git a/applications/utilities/miscellaneous/patchSummary/Make/options b/applications/utilities/miscellaneous/patchSummary/Make/options new file mode 100644 index 0000000000..fa15f12452 --- /dev/null +++ b/applications/utilities/miscellaneous/patchSummary/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume diff --git a/applications/utilities/miscellaneous/patchSummary/patchSummary.C b/applications/utilities/miscellaneous/patchSummary/patchSummary.C new file mode 100644 index 0000000000..a2f8c986ba --- /dev/null +++ b/applications/utilities/miscellaneous/patchSummary/patchSummary.C @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + patchSummary + +Description + Writes fields and boundary condition info for each patch at each requested + time instance. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "volFields.H" +#include "IOobjectList.H" +#include "patchSummaryTemplates.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "addTimeOptions.H" +# include "setRootCase.H" +# include "createTime.H" + + // Get times list + instantList Times = runTime.times(); + + // set startTime and endTime depending on -time and -latestTime options +# include "checkTimeOptions.H" + + runTime.setTime(Times[startTime], startTime); + +# include "createMesh.H" + + for (label i=startTime; i(vsf, obj, objI, mesh); + addToFieldList(vvf, obj, objI, mesh); + addToFieldList(vsptf, obj, objI, mesh); + addToFieldList(vsytf, obj, objI, mesh); + addToFieldList(vtf, obj, objI, mesh); + } + } + + Info<< endl; + + const polyBoundaryMesh& bm = mesh.boundaryMesh(); + forAll(bm, patchI) + { + Info<< "Patch: " << bm[patchI].name() << nl; + outputFieldList(vsf, patchI); + outputFieldList(vvf, patchI); + outputFieldList(vsptf, patchI); + outputFieldList(vsytf, patchI); + outputFieldList(vtf, patchI); + Info << endl; + } + } + + Info << "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/molecule/potentials/pairPotential/basic/pairPotentialI.H b/applications/utilities/miscellaneous/patchSummary/patchSummaryTemplates.C old mode 100755 new mode 100644 similarity index 53% rename from src/lagrangian/molecule/potentials/pairPotential/basic/pairPotentialI.H rename to applications/utilities/miscellaneous/patchSummary/patchSummaryTemplates.C index 3a3efa223a..57123fd117 --- a/src/lagrangian/molecule/potentials/pairPotential/basic/pairPotentialI.H +++ b/applications/utilities/miscellaneous/patchSummary/patchSummaryTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,80 +22,53 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + \*---------------------------------------------------------------------------*/ -inline Foam::scalar Foam::pairPotential::m() const -{ - return m_; -} +#include "patchSummaryTemplates.H" +#include "IOmanip.H" +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -inline Foam::scalar Foam::pairPotential::gamma() const -{ - return gamma_; -} - - -inline Foam::scalar Foam::pairPotential::rm() const -{ - return rm_; -} - - -inline Foam::scalar Foam::pairPotential::epsilon() const -{ - return epsilon_; -} - - -inline Foam::scalar Foam::pairPotential::rCut() const -{ - return rCut_; -} - - -inline Foam::scalar Foam::pairPotential::rCutSqr() const -{ - return rCutSqr_; -} - - -inline Foam::scalar Foam::pairPotential::rMin() const -{ - return rMin_; -} - - -inline Foam::scalar Foam::pairPotential::dr() const -{ - return dr_; -} - - -// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // - -inline bool Foam::operator== +template +void Foam::addToFieldList ( - const pairPotential& a, - const pairPotential& b + PtrList >& fieldList, + const IOobject& obj, + const label fieldI, + const fvMesh& mesh ) { - return - (a.m() == b.m()) - && (a.gamma() == b.gamma()) - && (a.rm() == b.rm()) - && (a.epsilon() == b.epsilon()) - && (a.rCut() == b.rCut()); + typedef GeometricField fieldType; + + if (obj.headerClassName() == fieldType::typeName) + { + fieldList.set + ( + fieldI, + new fieldType(obj, mesh) + ); + Info<< " " << fieldType::typeName << tab << obj.name() << endl; + } } -inline bool Foam::operator!= +template +void Foam::outputFieldList ( - const pairPotential& a, - const pairPotential& b + PtrList >& fieldList, + const label patchI ) { - return !(a == b); + forAll(fieldList, fieldI) + { + if (fieldList.set(fieldI)) + { + Info<< " " << pTraits::typeName << tab << tab + << fieldList[fieldI].name() << tab << tab + << fieldList[fieldI].boundaryField()[patchI].type() << nl; + } + } } diff --git a/src/lagrangian/molecule/potentials/tetherPotential/tetherPotentialI.H b/applications/utilities/miscellaneous/patchSummary/patchSummaryTemplates.H old mode 100755 new mode 100644 similarity index 67% rename from src/lagrangian/molecule/potentials/tetherPotential/tetherPotentialI.H rename to applications/utilities/miscellaneous/patchSummary/patchSummaryTemplates.H index d9ca0dae1a..e29db21fc3 --- a/src/lagrangian/molecule/potentials/tetherPotential/tetherPotentialI.H +++ b/applications/utilities/miscellaneous/patchSummary/patchSummaryTemplates.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd. + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,33 +24,42 @@ License \*---------------------------------------------------------------------------*/ +#ifndef patchSummaryTemplates_H +#define patchSummaryTemplates_H + +#include "fvCFD.H" +#include "volFields.H" + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + template + void addToFieldList + ( + PtrList >& fieldList, + const IOobject& obj, + const label fieldI, + const fvMesh& mesh + ); -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -inline const word& tetherPotential::tetherPotentialName() const -{ - return tetherPotentialName_; -} - - -inline const word& tetherPotential::tetherPotentialType() const -{ - return tetherPotentialType_; -} - - -inline scalar tetherPotential::springConstant() const -{ - return springConstant_; -} + template + void outputFieldList + ( + PtrList >& fieldList, + const label patchI + ); +} // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +#ifdef NoRepository +# include "patchSummaryTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif // ************************************************************************* // diff --git a/applications/utilities/preProcessing/molConfig/Make/options b/applications/utilities/preProcessing/molConfig/Make/options index 196a4d66dd..aab9a2ca4f 100755 --- a/applications/utilities/preProcessing/molConfig/Make/options +++ b/applications/utilities/preProcessing/molConfig/Make/options @@ -3,7 +3,8 @@ EXE_INC = \ -I$(velocityDistributions) \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/lagrangian/molecule/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude @@ -12,4 +13,5 @@ EXE_LIBS = \ -ldynamicMesh \ -lfiniteVolume \ -llagrangian \ - -lmolecule + -lmolecule \ + -lpotential diff --git a/bin/foamLog b/bin/foamLog index 28e97a4630..0848d50cc1 100755 --- a/bin/foamLog +++ b/bin/foamLog @@ -47,7 +47,7 @@ printUsage() { cat < +Usage: $PROGNAME [-n][-s] extracts xy files from log $PROGNAME -l lists but does not extract @@ -82,11 +82,11 @@ files with the extracted data only. The query database is a simple text format with three entries per line, separated with '/'. Column 1 is the name of the variable (cannot contain -spaces), column 2 is the regular expression to select the line and -column 3 is the string to select the column inside the line. The value -taken will be the first (non-space)word after this column. -The database will either be \$HOME/.${PROGNAME}.db or if not found -$PROGDIR/${PROGNAME}.db. +spaces), column 2 is the extended regular expression (egrep) to select +the line and column 3 is the string (fgrep) to select the column inside the +line. The value taken will be the first (non-space)word after this +column. The database will either be \$HOME/.${PROGNAME}.db or if not +found $PROGDIR/${PROGNAME}.db. Option -s suppresses the default information and only prints the extracted variables. @@ -105,7 +105,7 @@ myEcho() { # getSolvedVars logFile # Prints names of all 'solved for' variables in the log file. getSolvedVars() { - grep ' Solving for ' $1 | fgrep ',' | sed -e 's/.* Solving for \([^,]*\)[,:].*/\1/' | sort -u + fgrep ' Solving for ' $1 | fgrep ',' | sed -e 's/.* Solving for \([^,]*\)[,:].*/\1/' | sort -u } @@ -163,7 +163,7 @@ getAllQueries() { for var in $dbQueries do getQueries $1 "$var" - line=`grep "$LINEQ" $2` + line=`egrep "$LINEQ" $2` if [ "$line" ]; then column=`echo "$line" | fgrep "$NUMQ"` if [ "$column" ]; then @@ -228,14 +228,13 @@ if [ "$LISTONLY" ]; then exit 0 fi -if [ $# -ne 3 ]; then +if [ $# -ne 1 ]; then printUsage exit 1 fi -ROOT=$1 -CASE=$2 -LOG=$3 +CASEDIR=. +LOG=$1 if [ ! -r $LOG ]; then echo "$PROGNAME: Cannot read log $LOG" exit 1 @@ -244,13 +243,13 @@ fi QUERYNAMES=`getAllQueries $DBFILE $LOG` -if [ ! "$ROOT" -o ! "$CASE" ]; then +if [ ! "$CASEDIR" ]; then printUsage exit 1 fi -if [ ! -d "$ROOT/$CASE" ]; then - echo "$PROGNAME: Cannot read $ROOT/$CASE" +if [ ! -d "$CASEDIR" ]; then + echo "$PROGNAME: Cannot read $CASEDIR" exit 1 fi @@ -262,16 +261,14 @@ fi #-- Make logs dir in case directory and put awk file there. -mkdir -p $ROOT/$CASE/logs -AWKFILE=$ROOT/$CASE/logs/$PROGNAME.awk +mkdir -p $CASEDIR/logs +AWKFILE=$CASEDIR/logs/$PROGNAME.awk myEcho "Using:" -myEcho " root : $ROOT" -myEcho " case : $CASE" myEcho " log : $LOG" myEcho " database : $DBFILE" myEcho " awk file : $AWKFILE" -myEcho " files to : $ROOT/$CASE/logs" +myEcho " files to : $CASEDIR/logs" myEcho "" @@ -364,19 +361,19 @@ cat <> $AWKFILE varName=varNameVal[1] file=varName "_" subIter[varName]++ - file="$ROOT/$CASE/logs/" file + file="$CASEDIR/logs/" file extract(\$0, "Initial residual = ", val) print $TIMENAME "\t" val[1] > file varName=varNameVal[1] "FinalRes" file=varName "_" subIter[varName]++ - file="$ROOT/$CASE/logs/" file + file="$CASEDIR/logs/" file extract(\$0, "Final residual = ", val) print $TIMENAME "\t" val[1] > file varName=varNameVal[1] "Iters" file=varName "_" subIter[varName]++ - file="$ROOT/$CASE/logs/" file + file="$CASEDIR/logs/" file extract(\$0, "No Iterations ", val) print $TIMENAME "\t" val[1] > file } @@ -393,7 +390,7 @@ do echo "#-- Extraction of $queryName" >> $AWKFILE echo "/$LINEQ/ {" >> $AWKFILE echo " extract(\$0, \"$NUMQ\", val)" >> $AWKFILE - echo " file=\"$ROOT/$CASE/logs/${queryName}_\" ${counter}" >> $AWKFILE + echo " file=\"$CASEDIR/logs/${queryName}_\" ${counter}" >> $AWKFILE echo " print $TIMENAME \"\\t\" val[1] > file" >> $AWKFILE echo " ${counter}++" >> $AWKFILE echo "}" >> $AWKFILE diff --git a/bin/foamLog.db b/bin/foamLog.db index 933dae1a8d..49d551f32c 100644 --- a/bin/foamLog.db +++ b/bin/foamLog.db @@ -48,6 +48,6 @@ epsMax/bounding epsilon,/max: epsAvg/bounding epsilon,/average: #- gamma bounding -gammaMin/Min\(gamma\) =/Min(gamma) = -gammaMax/Max\(gamma\) =/Max(gamma) = +gammaMin/Min\(gamma\) =/Min(gamma) = +gammaMax/Max\(gamma\) =/Max(gamma) = diff --git a/bin/upgradeTurbulenceProperties b/bin/upgradeTurbulenceProperties new file mode 100755 index 0000000000..35de08f093 --- /dev/null +++ b/bin/upgradeTurbulenceProperties @@ -0,0 +1,85 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# Script +# upgradeTurbulenceProperties +# +# Description +# Upgrade the turbulenceProperties dictionary to the new format employed +# in OpenFOAM version 1.5 +# - RAS turbulence models now defined by the RASProperties dictionary, +# and RASModel keyword, and +# - LES turbulence models now defined by the LESProperties dictionary, +# and LESModel keyword. +# +#------------------------------------------------------------------------------ + +printUsage() +{ + echo "Usage: `basename $0` " + echo " Where is the full path to the" + echo " turbulenceProperties dictionary" +} + +convertDict() +{ + echo " Identified $1 turbulence model" + + sed -e "s/turbulenceProperties/$1Properties/" \ + -e "s/$2/$1Model/" \ + -e "s/[a-zA-Z0-9]* [ ]*\[[0-9 ]*\]//" \ + $3 > "$outputPath/$1Properties" + + echo " written $1Properties to $outputPath/" +} + +outputPath=`dirname $1` + +if [ $# -ne 1 ]; then + printUsage + exit 1 +elif [ ! -e $1 ]; then + echo " Error: file $1 does not exist" + echo "" + printUsage + exit 1 +fi + +# Identify type of turbulence model +RAS=`grep turbulenceModel $1` +LES=`grep LESmodel $1` + +if [ -n "$RAS" ]; then + convertDict "RAS" "turbulenceModel" $1 +elif [ -n "$LES" ]; then + convertDict "LES" "LESmodel" $1 +else + echo "Unable to determine turbulence model type - nothing changed" + exit 1 +fi + +echo "done." + +exit 0 diff --git a/doc/Doxygen/tools/README b/doc/Doxygen/tools/README index 0a3a9ceecb..86c4e8ae73 100644 --- a/doc/Doxygen/tools/README +++ b/doc/Doxygen/tools/README @@ -11,4 +11,5 @@ Misc Tools 1. find-templateInComments 2. find-its 3. find-junkFiles +4. find-longlines diff --git a/doc/Doxygen/tools/find-longlines b/doc/Doxygen/tools/find-longlines new file mode 100755 index 0000000000..c5294715d8 --- /dev/null +++ b/doc/Doxygen/tools/find-longlines @@ -0,0 +1,46 @@ +#!/usr/bin/perl -w +use strict; +use File::Find (); + +# ----------------------------------------------------------------------------- +# +# Script +# find-longlines +# +# Description +# Search for *.[CH] files that exceed the 80-column width +# +# - print filename lineNumber and offending line (with truncation point) +# +# ----------------------------------------------------------------------------- + +my $maxlen = 80; +my $re_filespec = qr{^.+\.[CH]$}; +my $count; + +sub wanted { + unless ( lstat($_) and -f _ and -r _ and not -l _ and /$re_filespec/ ) { + return; + } + + local @ARGV = $_; + while (<>) { + chomp; + s{\s+$}{}; # trim + + if ( $maxlen < length ) { + $count++; + substr( $_, $maxlen, 0 ) = "||->>"; # show truncation point + print "$ARGV $. $_\n"; + } + } + close ARGV; +} + +## Traverse desired filesystems +for my $dir (@ARGV) { + no warnings 'File::Find'; + warn "(**) checking '$dir' ...\n"; + File::Find::find( { wanted => \&wanted }, $dir ); +} + diff --git a/src/OpenFOAM/db/IOstreams/gzstream/gzstream.C.1.7 b/src/OpenFOAM/db/IOstreams/gzstream/gzstream.C.1.7 deleted file mode 100644 index 361609a24a..0000000000 --- a/src/OpenFOAM/db/IOstreams/gzstream/gzstream.C.1.7 +++ /dev/null @@ -1,165 +0,0 @@ -// ============================================================================ -// gzstream, C++ iostream classes wrapping the zlib compression library. -// Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// ============================================================================ -// -// File : gzstream.C -// Revision : $Revision: 1.7 $ -// Revision_date : $Date: 2003/01/08 14:41:27 $ -// Author(s) : Deepak Bandyopadhyay, Lutz Kettner -// -// Standard streambuf implementation following Nicolai Josuttis, "The -// Standard C++ Library". -// ============================================================================ - -#include -#include -#include // for memcpy - -#ifdef GZSTREAM_NAMESPACE -namespace GZSTREAM_NAMESPACE { -#endif - -// ---------------------------------------------------------------------------- -// Internal classes to implement gzstream. See header file for user classes. -// ---------------------------------------------------------------------------- - -// -------------------------------------- -// class gzstreambuf: -// -------------------------------------- - -gzstreambuf* gzstreambuf::open( const char* name, int open_mode) { - if ( is_open()) - return reinterpret_cast(0); - mode = open_mode; - // no append nor read/write mode - if ((mode & std::ios::ate) || (mode & std::ios::app) - || ((mode & std::ios::in) && (mode & std::ios::out))) - return reinterpret_cast(0); - char fmode[10]; - char* fmodeptr = fmode; - if ( mode & std::ios::in) - *fmodeptr++ = 'r'; - else if ( mode & std::ios::out) - *fmodeptr++ = 'w'; - *fmodeptr++ = 'b'; - *fmodeptr = '\0'; - file = gzopen( name, fmode); - if (file == 0) - return reinterpret_cast(0); - opened = 1; - return this; -} - -gzstreambuf * gzstreambuf::close() { - if ( is_open()) { - sync(); - opened = 0; - if ( gzclose( file) == Z_OK) - return this; - } - return reinterpret_cast(0); -} - -int gzstreambuf::underflow() { // used for input buffer only - if ( gptr() && ( gptr() < egptr())) - return * reinterpret_cast( gptr()); - - if ( ! (mode & std::ios::in) || ! opened) - return EOF; - // Josuttis' implementation of inbuf - int n_putback = gptr() - eback(); - if ( n_putback > 4) - n_putback = 4; - memcpy( buffer + (4 - n_putback), gptr() - n_putback, n_putback); - - int num = gzread( file, buffer+4, bufferSize-4); - if (num <= 0) // ERROR or EOF - return EOF; - - // reset buffer pointers - setg( buffer + (4 - n_putback), // beginning of putback area - buffer + 4, // read position - buffer + 4 + num); // end of buffer - - // return next character - return * reinterpret_cast( gptr()); -} - -int gzstreambuf::flush_buffer() { - // Separate the writing of the buffer from overflow() and - // sync() operation. - int w = pptr() - pbase(); - if ( gzwrite( file, pbase(), w) != w) - return EOF; - pbump( -w); - return w; -} - -int gzstreambuf::overflow( int c) { // used for output buffer only - if ( ! ( mode & std::ios::out) || ! opened) - return EOF; - if (c != EOF) { - *pptr() = c; - pbump(1); - } - if ( flush_buffer() == EOF) - return EOF; - return c; -} - -int gzstreambuf::sync() { - // Changed to use flush_buffer() instead of overflow( EOF) - // which caused improper behavior with std::endl and flush(), - // bug reported by Vincent Ricard. - if ( pptr() && pptr() > pbase()) { - if ( flush_buffer() == EOF) - return -1; - } - return 0; -} - -// -------------------------------------- -// class gzstreambase: -// -------------------------------------- - -gzstreambase::gzstreambase( const char* name, int mode) { - init( &buf); - open( name, mode); -} - -gzstreambase::~gzstreambase() { - buf.close(); -} - -void gzstreambase::open( const char* name, int open_mode) { - if ( ! buf.open( name, open_mode)) - clear( rdstate() | std::ios::badbit); -} - -void gzstreambase::close() { - if ( buf.is_open()) - if ( ! buf.close()) - clear( rdstate() | std::ios::badbit); -} - -#ifdef GZSTREAM_NAMESPACE -} // namespace GZSTREAM_NAMESPACE -#endif - -// ============================================================================ -// EOF // diff --git a/src/OpenFOAM/db/IOstreams/gzstream/gzstream.h.1.5 b/src/OpenFOAM/db/IOstreams/gzstream/gzstream.h.1.5 deleted file mode 100644 index 861653f481..0000000000 --- a/src/OpenFOAM/db/IOstreams/gzstream/gzstream.h.1.5 +++ /dev/null @@ -1,121 +0,0 @@ -// ============================================================================ -// gzstream, C++ iostream classes wrapping the zlib compression library. -// Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library 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 -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// ============================================================================ -// -// File : gzstream.h -// Revision : $Revision: 1.5 $ -// Revision_date : $Date: 2002/04/26 23:30:15 $ -// Author(s) : Deepak Bandyopadhyay, Lutz Kettner -// -// Standard streambuf implementation following Nicolai Josuttis, "The -// Standard C++ Library". -// ============================================================================ - -#ifndef GZSTREAM_H -#define GZSTREAM_H 1 - -// standard C++ with new header file names and std:: namespace -#include -#include -#include - -#ifdef GZSTREAM_NAMESPACE -namespace GZSTREAM_NAMESPACE { -#endif - -// ---------------------------------------------------------------------------- -// Internal classes to implement gzstream. See below for user classes. -// ---------------------------------------------------------------------------- - -class gzstreambuf : public std::streambuf { -private: - static const int bufferSize = 47+256; // size of data buff - // totals 512 bytes under g++ for igzstream at the end. - - gzFile file; // file handle for compressed file - char buffer[bufferSize]; // data buffer - char opened; // open/close state of stream - int mode; // I/O mode - - int flush_buffer(); -public: - gzstreambuf() : opened(0) { - setp( buffer, buffer + (bufferSize-1)); - setg( buffer + 4, // beginning of putback area - buffer + 4, // read position - buffer + 4); // end position - // ASSERT: both input & output capabilities will not be used together - } - int is_open() { return opened; } - gzstreambuf* open( const char* name, int open_mode); - gzstreambuf* close(); - ~gzstreambuf() { close(); } - - virtual int overflow( int c = EOF); - virtual int underflow(); - virtual int sync(); -}; - -class gzstreambase : virtual public std::ios { -protected: - gzstreambuf buf; -public: - gzstreambase() { init(&buf); } - gzstreambase( const char* name, int open_mode); - ~gzstreambase(); - void open( const char* name, int open_mode); - void close(); - gzstreambuf* rdbuf() { return &buf; } -}; - -// ---------------------------------------------------------------------------- -// User classes. Use igzstream and ogzstream analogously to ifstream and -// ofstream respectively. They read and write files based on the gz* -// function interface of the zlib. Files are compatible with gzip compression. -// ---------------------------------------------------------------------------- - -class igzstream : public gzstreambase, public std::istream { -public: - igzstream() : std::istream( &buf) {} - igzstream( const char* name, int open_mode = std::ios::in) - : gzstreambase( name, open_mode), std::istream( &buf) {} - gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } - void open( const char* name, int open_mode = std::ios::in) { - gzstreambase::open( name, open_mode); - } -}; - -class ogzstream : public gzstreambase, public std::ostream { -public: - ogzstream() : std::ostream( &buf) {} - ogzstream( const char* name, int mode = std::ios::out) - : gzstreambase( name, mode), std::ostream( &buf) {} - gzstreambuf* rdbuf() { return gzstreambase::rdbuf(); } - void open( const char* name, int open_mode = std::ios::out) { - gzstreambase::open( name, open_mode); - } -}; - -#ifdef GZSTREAM_NAMESPACE -} // namespace GZSTREAM_NAMESPACE -#endif - -#endif // GZSTREAM_H -// ============================================================================ -// EOF // - diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H index 6576e3699c..790ef687b9 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.H @@ -803,7 +803,7 @@ public: ( const dictionary& shrinkDict, const dictionary& motionDict, - const scalar nAllowableErrors, + const label nAllowableErrors, motionSmoother& ); diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriverLayers.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriverLayers.C index 1cfbee79d4..1de6e845fb 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriverLayers.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriverLayers.C @@ -2346,7 +2346,7 @@ void Foam::autoHexMeshDriver::addLayers ( const dictionary& shrinkDict, const dictionary& motionDict, - const scalar nAllowableErrors, + const label nAllowableErrors, motionSmoother& meshMover ) { diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index c899636dce..d0e560c73b 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -103,8 +103,6 @@ $(derivedFvPatchFields)/timeVaryingUniformTotalPressure/timeVaryingUniformTotalP $(derivedFvPatchFields)/totalTemperature/totalTemperatureFvPatchScalarField.C $(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C -$(derivedFvPatchFields)/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C -$(derivedFvPatchFields)/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C $(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C $(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C index 1a1d940193..c2fca0bbd9 100644 --- a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C +++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C @@ -32,15 +32,28 @@ License // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // // adjust negative resistance values to be multiplier of max value -void Foam::porousZone::adjustNegativeResistance(vector& resist) +void Foam::porousZone::adjustNegativeResistance(dimensionedVector& resist) { - scalar maxCmpt = max(0, cmptMax(resist)); + scalar maxCmpt = max(0, cmptMax(resist.value())); - for (label cmpt=0; cmpt < vector::nComponents; ++cmpt) + if (maxCmpt < 0) { - if (resist[cmpt] < 0) + FatalErrorIn + ( + "Foam::porousZone::porousZone::adjustNegativeResistance" + "(dimensionedVector&)" + ) << "negative resistances! " << resist + << exit(FatalError); + } + else + { + vector& val = resist.value(); + for (label cmpt=0; cmpt < vector::nComponents; ++cmpt) { - resist[cmpt] *= -maxCmpt; + if (val[cmpt] < 0) + { + val[cmpt] *= -maxCmpt; + } } } } @@ -71,24 +84,20 @@ Foam::porousZone::porousZone FatalErrorIn ( "Foam::porousZone::porousZone" - "(const fvMesh&, const Istream&)" + "(const fvMesh&, const word&, const dictionary&)" ) << "cannot find porous cellZone " << name_ << exit(FatalError); } - // local-to-global transformation tensor - const tensor& E = coordSys_.R(); - // porosity - if (dict_.found("porosity")) + if (dict_.readIfPresent("porosity", porosity_)) { - dict_.lookup("porosity") >> porosity_; - if (porosity_ <= 0.0 || porosity_ > 1.0) { FatalIOErrorIn ( - "Foam::porousZone::porousZone(const fvMesh&, const Istream&)", + "Foam::porousZone::porousZone" + "(const fvMesh&, const word&, const dictionary&)", dict_ ) << "out-of-range porosity value " << porosity_ @@ -97,73 +106,64 @@ Foam::porousZone::porousZone } // powerLaw coefficients - if (dict_.found("powerLaw")) + if (const dictionary* dictPtr = dict_.subDictPtr("powerLaw")) { - const dictionary& subDict = dict_.subDict("powerLaw"); - if (subDict.found("C0")) - { - subDict.lookup("C0") >> C0_; - } - if (subDict.found("C1")) - { - subDict.lookup("C1") >> C1_; - } + dictPtr->readIfPresent("C0", C0_); + dictPtr->readIfPresent("C1", C1_); } // Darcy-Forchheimer coefficients - if (dict_.found("Darcy")) + if (const dictionary* dictPtr = dict_.subDictPtr("Darcy")) { - const dictionary& subDict = dict_.subDict("Darcy"); + // local-to-global transformation tensor + const tensor& E = coordSys_.R(); - dimensionedVector d("d", D_.dimensions(), vector::zero); - dimensionedVector f("f", F_.dimensions(), vector::zero); - - if (subDict.found("d")) + dimensionedVector d(vector::zero); + if (dictPtr->readIfPresent("d", d)) { - // d = dimensionedVector("d", subDict.lookup("d")); - subDict.lookup("d") >> d; - adjustNegativeResistance(d.value()); + if (D_.dimensions() != d.dimensions()) + { + FatalIOErrorIn + ( + "Foam::porousZone::porousZone" + "(const fvMesh&, const word&, const dictionary&)", + dict_ + ) << "incorrect dimensions for d: " << d.dimensions() + << " should be " << D_.dimensions() + << exit(FatalIOError); + } - } - if (subDict.found("f")) - { - // f = dimensionedVector("f", subDict.lookup("f")); - subDict.lookup("f") >> f; - adjustNegativeResistance(f.value()); + adjustNegativeResistance(d); + + D_.value().xx() = d.value().x(); + D_.value().yy() = d.value().y(); + D_.value().zz() = d.value().z(); + D_.value() = (E & D_ & E.T()).value(); } - if (D_.dimensions() != d.dimensions()) + dimensionedVector f(vector::zero); + if (dictPtr->readIfPresent("f", f)) { - FatalIOErrorIn - ( - "Foam::porousZone::porousZone(const fvMesh&, const Istream&)", - dict_ - ) << "incorrect dimensions for d: " << d.dimensions() - << " should be " << D_.dimensions() - << exit(FatalIOError); + if (F_.dimensions() != f.dimensions()) + { + FatalIOErrorIn + ( + "Foam::porousZone::porousZone" + "(const fvMesh&, const word&, const dictionary&)", + dict_ + ) << "incorrect dimensions for f: " << f.dimensions() + << " should be " << F_.dimensions() + << exit(FatalIOError); + } + + adjustNegativeResistance(f); + + // leading 0.5 is from 1/2 * rho + F_.value().xx() = 0.5*f.value().x(); + F_.value().yy() = 0.5*f.value().y(); + F_.value().zz() = 0.5*f.value().z(); + F_.value() = (E & F_ & E.T()).value(); } - - if (F_.dimensions() != f.dimensions()) - { - FatalIOErrorIn - ( - "Foam::porousZone::porousZone(const fvMesh&, const Istream&)", - dict_ - ) << "incorrect dimensions for f: " << f.dimensions() - << " should be " << F_.dimensions() - << exit(FatalIOError); - } - - D_.value().xx() = d.value().x(); - D_.value().yy() = d.value().y(); - D_.value().zz() = d.value().z(); - D_.value() = (E & D_ & E.T()).value(); - - // leading 0.5 is from 1/2 * rho - F_.value().xx() = 0.5*f.value().x(); - F_.value().yy() = 0.5*f.value().y(); - F_.value().zz() = 0.5*f.value().z(); - F_.value() = (E & F_ & E.T()).value(); } // provide some feedback for the user @@ -179,7 +179,8 @@ Foam::porousZone::porousZone { FatalIOErrorIn ( - "Foam::porousZone::porousZone(const fvMesh&, const Istream&)", + "Foam::porousZone::porousZone" + "(const fvMesh&, const word&, const dictionary&)", dict_ ) << "neither powerLaw (C0/C1) " "nor Darcy-Forchheimer law (d/f) specified" diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H index eb58f7bb47..671c39fa45 100644 --- a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H +++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H @@ -128,7 +128,7 @@ class porousZone // Private Member Functions //- adjust negative resistance values to be multiplier of max value - static void adjustNegativeResistance(vector& resist); + static void adjustNegativeResistance(dimensionedVector& resist); //- Power-law resistance template diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake index 567f7a10de..0a5e86bdef 100755 --- a/src/lagrangian/Allwmake +++ b/src/lagrangian/Allwmake @@ -5,4 +5,6 @@ wmake libso basic wmake libso solidParticle wmake libso intermediate wmake libso dieselSpray -wmake libso molecule +(cd molecularDynamics && wmake libso potential) +(cd molecularDynamics && wmake libso molecule) + diff --git a/src/lagrangian/molecule/Make/files b/src/lagrangian/molecularDynamics/molecule/Make/files similarity index 83% rename from src/lagrangian/molecule/Make/files rename to src/lagrangian/molecularDynamics/molecule/Make/files index d8063d0974..0bb1acc49b 100755 --- a/src/lagrangian/molecule/Make/files +++ b/src/lagrangian/molecularDynamics/molecule/Make/files @@ -11,11 +11,6 @@ referredMolecule = referredMolecule referredCellList = referredCellList referredCell = referredCell referralLists = referralLists - -potentials = potentials -pairPotential = $(potentials)/pairPotential -tetherPotential = $(potentials)/tetherPotential - $(distribution)/distribution.C $(reducedUnits)/reducedUnits.C @@ -42,11 +37,6 @@ $(moleculeCloud)/moleculeCloudIntegrateEquationsOfMotion.C $(moleculeCloud)/moleculeCloudRemoveHighEnergyOverlaps.C $(moleculeCloud)/moleculeCloudApplyConstraintsAndThermostats.C -$(pairPotential)/basic/pairPotential.C -$(pairPotential)/basic/pairPotentialList.C -$(tetherPotential)/tetherPotential.C -$(tetherPotential)/tetherPotentialList.C - $(referralLists)/receivingReferralList.C $(referralLists)/sendingReferralList.C $(referredCellList)/referredCellList.C diff --git a/src/lagrangian/molecule/Make/options b/src/lagrangian/molecularDynamics/molecule/Make/options similarity index 57% rename from src/lagrangian/molecule/Make/options rename to src/lagrangian/molecularDynamics/molecule/Make/options index a0fb316eec..cc91fd4bbe 100755 --- a/src/lagrangian/molecule/Make/options +++ b/src/lagrangian/molecularDynamics/molecule/Make/options @@ -1,8 +1,10 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude EXE_LIBS = \ -lfiniteVolume \ - -llagrangian + -llagrangian \ + -lpotential diff --git a/src/lagrangian/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulator.C b/src/lagrangian/molecularDynamics/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulator.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulator.C rename to src/lagrangian/molecularDynamics/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulator.C diff --git a/src/lagrangian/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulator.H b/src/lagrangian/molecularDynamics/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulator.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulator.H rename to src/lagrangian/molecularDynamics/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulator.H diff --git a/src/lagrangian/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulatorI.H b/src/lagrangian/molecularDynamics/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulatorI.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulatorI.H rename to src/lagrangian/molecularDynamics/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulatorI.H diff --git a/src/lagrangian/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulatorIO.C b/src/lagrangian/molecularDynamics/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulatorIO.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulatorIO.C rename to src/lagrangian/molecularDynamics/molecule/correlationFunction/bufferedAccumulator/bufferedAccumulatorIO.C diff --git a/src/lagrangian/molecule/correlationFunction/correlationFunction.C b/src/lagrangian/molecularDynamics/molecule/correlationFunction/correlationFunction.C similarity index 100% rename from src/lagrangian/molecule/correlationFunction/correlationFunction.C rename to src/lagrangian/molecularDynamics/molecule/correlationFunction/correlationFunction.C diff --git a/src/lagrangian/molecule/correlationFunction/correlationFunction.H b/src/lagrangian/molecularDynamics/molecule/correlationFunction/correlationFunction.H similarity index 100% rename from src/lagrangian/molecule/correlationFunction/correlationFunction.H rename to src/lagrangian/molecularDynamics/molecule/correlationFunction/correlationFunction.H diff --git a/src/lagrangian/molecule/correlationFunction/correlationFunctionI.H b/src/lagrangian/molecularDynamics/molecule/correlationFunction/correlationFunctionI.H similarity index 100% rename from src/lagrangian/molecule/correlationFunction/correlationFunctionI.H rename to src/lagrangian/molecularDynamics/molecule/correlationFunction/correlationFunctionI.H diff --git a/src/lagrangian/molecule/correlationFunction/correlationFunctionIO.C b/src/lagrangian/molecularDynamics/molecule/correlationFunction/correlationFunctionIO.C similarity index 100% rename from src/lagrangian/molecule/correlationFunction/correlationFunctionIO.C rename to src/lagrangian/molecularDynamics/molecule/correlationFunction/correlationFunctionIO.C diff --git a/src/lagrangian/molecule/distribution/distribution.C b/src/lagrangian/molecularDynamics/molecule/distribution/distribution.C old mode 100755 new mode 100644 similarity index 97% rename from src/lagrangian/molecule/distribution/distribution.C rename to src/lagrangian/molecularDynamics/molecule/distribution/distribution.C index 717929e5e4..166391acb6 --- a/src/lagrangian/molecule/distribution/distribution.C +++ b/src/lagrangian/molecularDynamics/molecule/distribution/distribution.C @@ -135,7 +135,7 @@ scalar distribution::median() scalar runningSum = 0.0; - List< Pair > normDist(normalised()); + List > normDist(normalised()); if (normDist.size()) { @@ -259,7 +259,7 @@ List< Pair > distribution::normalised() sort(keys); - List< Pair > normDist(size()); + List > normDist(size()); forAll(keys,k) { @@ -282,9 +282,9 @@ List< Pair > distribution::normalisedMinusMean() List< Pair > distribution::normalisedShifted(const scalar shiftValue) { - List< Pair > oldDist(normalised()); + List > oldDist(normalised()); - List< Pair > newDist(oldDist.size()); + List > newDist(oldDist.size()); forAll(oldDist,u) { @@ -383,7 +383,7 @@ List< Pair > distribution::normalisedShifted(const scalar shiftValue) } -List< Pair > distribution::raw() +List > distribution::raw() { insertMissingKeys(); @@ -391,7 +391,7 @@ List< Pair > distribution::raw() sort(keys); - List< Pair > rawDist(size()); + List > rawDist(size()); forAll(keys,k) { diff --git a/src/lagrangian/molecule/distribution/distribution.H b/src/lagrangian/molecularDynamics/molecule/distribution/distribution.H old mode 100755 new mode 100644 similarity index 99% rename from src/lagrangian/molecule/distribution/distribution.H rename to src/lagrangian/molecularDynamics/molecule/distribution/distribution.H index c2de1055c1..3e222580ef --- a/src/lagrangian/molecule/distribution/distribution.H +++ b/src/lagrangian/molecularDynamics/molecule/distribution/distribution.H @@ -102,6 +102,7 @@ public: List > raw(); + // Access inline scalar binWidth() const; diff --git a/src/lagrangian/molecule/distribution/distributionI.H b/src/lagrangian/molecularDynamics/molecule/distribution/distributionI.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/distribution/distributionI.H rename to src/lagrangian/molecularDynamics/molecule/distribution/distributionI.H diff --git a/src/lagrangian/molecule/distribution/distributionIO.C b/src/lagrangian/molecularDynamics/molecule/distribution/distributionIO.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/distribution/distributionIO.C rename to src/lagrangian/molecularDynamics/molecule/distribution/distributionIO.C diff --git a/src/lagrangian/molecule/mdTools/averageMDFields.H b/src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/mdTools/averageMDFields.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/averageMDFields.H diff --git a/src/lagrangian/molecule/mdTools/calculateAutoCorrelationFunctions.H b/src/lagrangian/molecularDynamics/molecule/mdTools/calculateAutoCorrelationFunctions.H similarity index 84% rename from src/lagrangian/molecule/mdTools/calculateAutoCorrelationFunctions.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/calculateAutoCorrelationFunctions.H index a7c4c326bb..8f7574a077 100644 --- a/src/lagrangian/molecule/mdTools/calculateAutoCorrelationFunctions.H +++ b/src/lagrangian/molecularDynamics/molecule/mdTools/calculateAutoCorrelationFunctions.H @@ -79,5 +79,27 @@ if (mesh.time().timeIndex() % pacf.sampleSteps() == 0) if (mesh.time().timeIndex() % hfacf.sampleSteps() == 0) { -// hFacf.calculateCorrelationFunction(); + + IDLList::iterator mol(molecules.begin()); + + vector s = vector::zero; + + for + ( + mol = molecules.begin(); + mol != molecules.end(); + ++mol + ) + { + s += + ( + 0.5 * mol().mass() * magSqr(mol().U()) + + + mol().potentialEnergy() + ) * mol().U() + + + 0.5 * ( mol().rf() & mol().U() ); + } + + hfacf.calculateCorrelationFunction(s); } diff --git a/src/lagrangian/molecule/mdTools/calculateMDFields.H b/src/lagrangian/molecularDynamics/molecule/mdTools/calculateMDFields.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/mdTools/calculateMDFields.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/calculateMDFields.H diff --git a/src/lagrangian/molecule/mdTools/calculateTransportProperties.H b/src/lagrangian/molecularDynamics/molecule/mdTools/calculateTransportProperties.H similarity index 81% rename from src/lagrangian/molecule/mdTools/calculateTransportProperties.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/calculateTransportProperties.H index 15e0dab7e3..b0923c42db 100644 --- a/src/lagrangian/molecule/mdTools/calculateTransportProperties.H +++ b/src/lagrangian/molecularDynamics/molecule/mdTools/calculateTransportProperties.H @@ -59,7 +59,24 @@ Info<< "Viscosity = " if(writeHFacf) { - + OFstream hfacfFile + ( + runTime.path()/ + "hfacf" + ); + + if (!hfacf.writeAveraged(hfacfFile)) + { + FatalErrorIn(args.executable()) + << "Failed writing to " + << hfacfFile.name() + << abort(FatalError); + } } - +Info << "Thermal conductivity = " + << hfacf.integral() + /averageTemperature + /averageTemperature + /moleculeCloud::kb + / meshVolume + << endl; diff --git a/src/lagrangian/molecule/mdTools/createAutoCorrelationFunctions.H b/src/lagrangian/molecularDynamics/molecule/mdTools/createAutoCorrelationFunctions.H similarity index 100% rename from src/lagrangian/molecule/mdTools/createAutoCorrelationFunctions.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/createAutoCorrelationFunctions.H diff --git a/src/lagrangian/molecule/mdTools/createMDFields.H b/src/lagrangian/molecularDynamics/molecule/mdTools/createMDFields.H old mode 100755 new mode 100644 similarity index 80% rename from src/lagrangian/molecule/mdTools/createMDFields.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/createMDFields.H index f5742fd2c8..dccd1891a7 --- a/src/lagrangian/molecule/mdTools/createMDFields.H +++ b/src/lagrangian/molecularDynamics/molecule/mdTools/createMDFields.H @@ -2,25 +2,25 @@ List< scalarField > allSpeciesN_RU ( - molecules.nIds(), + molecules.pairPotentials().nIds(), scalarField (mesh.nCells(), 0.0) ); List< scalarField > allSpeciesM_RU ( - molecules.nIds(), + molecules.pairPotentials().nIds(), scalarField (mesh.nCells(), 0.0) ); List< vectorField > allSpeciesVelocitySum_RU ( - molecules.nIds(), + molecules.pairPotentials().nIds(), vectorField (mesh.nCells(), vector::zero) ); List< scalarField > allSpeciesVelocityMagSquaredSum_RU ( - molecules.nIds(), + molecules.pairPotentials().nIds(), scalarField (mesh.nCells(), 0.0) ); @@ -34,13 +34,13 @@ Info << nl << "Creating fields." << endl; PtrList allSpeciesRhoN ( - molecules.nIds() + molecules.pairPotentials().nIds() ); forAll (allSpeciesRhoN, rN) { Info << " Creating number density field for " - << molecules.idList()[rN] << endl; + << molecules.pairPotentials().idList()[rN] << endl; allSpeciesRhoN.set ( @@ -49,7 +49,7 @@ forAll (allSpeciesRhoN, rN) ( IOobject ( - "rhoN_" + molecules.idList()[rN], + "rhoN_" + molecules.pairPotentials().idList()[rN], runTime.timeName(), mesh, IOobject::NO_READ, @@ -89,13 +89,13 @@ totalRhoN.correctBoundaryConditions(); PtrList allSpeciesRhoM ( - molecules.nIds() + molecules.pairPotentials().nIds() ); forAll (allSpeciesRhoM, rM) { Info << " Creating mass density field for " - << molecules.idList()[rM] << endl; + << molecules.pairPotentials().idList()[rM] << endl; allSpeciesRhoM.set ( @@ -104,7 +104,7 @@ forAll (allSpeciesRhoM, rM) ( IOobject ( - "rhoM_" + molecules.idList()[rM], + "rhoM_" + molecules.pairPotentials().idList()[rM], runTime.timeName(), mesh, IOobject::NO_READ, @@ -144,13 +144,13 @@ totalRhoM.correctBoundaryConditions(); PtrList allSpeciesVelocity ( - molecules.nIds() + molecules.pairPotentials().nIds() ); forAll (allSpeciesVelocity, v) { Info << " Creating velocity field for " - << molecules.idList()[v] << endl; + << molecules.pairPotentials().idList()[v] << endl; allSpeciesVelocity.set ( @@ -159,7 +159,7 @@ forAll (allSpeciesVelocity, v) ( IOobject ( - "velocity_" + molecules.idList()[v], + "velocity_" + molecules.pairPotentials().idList()[v], runTime.timeName(), mesh, IOobject::NO_READ, @@ -177,22 +177,40 @@ forAll (allSpeciesVelocity, v) Info << " Creating total velocity field" << endl; +// volVectorField totalVelocity +// ( +// IOobject +// ( +// "velocity_total", +// runTime.timeName(), +// mesh, +// IOobject::NO_READ, +// IOobject::AUTO_WRITE +// ), +// mesh, +// dimVelocity, +// "zeroGradient" +// ); +// totalVelocity.internalField() = vectorField (mesh.nCells(), vector::zero); +// totalVelocity.correctBoundaryConditions(); + + volVectorField totalVelocity + ( IOobject ( - "velocity_total", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE + + "velocity_total", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), mesh, - dimVelocity, - "zeroGradient" + dimensionedVector("zero", dimVelocity, vector::zero) ); -totalVelocity.internalField() = vectorField (mesh.nCells(), vector::zero); -totalVelocity.correctBoundaryConditions(); /*---------------------------------------------------------------------------*\ Kinetic temperature @@ -200,13 +218,13 @@ totalVelocity.correctBoundaryConditions(); PtrList allSpeciesTemperature ( - molecules.nIds() + molecules.pairPotentials().nIds() ); forAll (allSpeciesTemperature, t) { Info << " Creating temperature field for " - << molecules.idList()[t] << endl; + << molecules.pairPotentials().idList()[t] << endl; allSpeciesTemperature.set ( @@ -215,7 +233,7 @@ forAll (allSpeciesTemperature, t) ( IOobject ( - "temperature_" + molecules.idList()[t], + "temperature_" + molecules.pairPotentials().idList()[t], runTime.timeName(), mesh, IOobject::NO_READ, @@ -256,13 +274,13 @@ totalTemperature.correctBoundaryConditions(); PtrList allSpeciesMeanKE ( - molecules.nIds() + molecules.pairPotentials().nIds() ); forAll (allSpeciesMeanKE, mKE) { Info << " Creating mean kinetic energy field for " - << molecules.idList()[mKE] << endl; + << molecules.pairPotentials().idList()[mKE] << endl; allSpeciesMeanKE.set ( @@ -271,7 +289,7 @@ forAll (allSpeciesMeanKE, mKE) ( IOobject ( - "meanKE_" + molecules.idList()[mKE], + "meanKE_" + molecules.pairPotentials().idList()[mKE], runTime.timeName(), mesh, IOobject::NO_READ, diff --git a/src/lagrangian/molecule/mdTools/createRefUnits.H b/src/lagrangian/molecularDynamics/molecule/mdTools/createRefUnits.H similarity index 100% rename from src/lagrangian/molecule/mdTools/createRefUnits.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/createRefUnits.H diff --git a/src/lagrangian/molecule/mdTools/md.H b/src/lagrangian/molecularDynamics/molecule/mdTools/md.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/mdTools/md.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/md.H diff --git a/src/lagrangian/molecule/mdTools/meanMomentumEnergyAndNMols.H b/src/lagrangian/molecularDynamics/molecule/mdTools/meanMomentumEnergyAndNMols.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/mdTools/meanMomentumEnergyAndNMols.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/meanMomentumEnergyAndNMols.H diff --git a/src/lagrangian/molecule/mdTools/resetMDFields.H b/src/lagrangian/molecularDynamics/molecule/mdTools/resetMDFields.H old mode 100755 new mode 100644 similarity index 72% rename from src/lagrangian/molecule/mdTools/resetMDFields.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/resetMDFields.H index e5fdbbd8a4..337647ec02 --- a/src/lagrangian/molecule/mdTools/resetMDFields.H +++ b/src/lagrangian/molecularDynamics/molecule/mdTools/resetMDFields.H @@ -2,25 +2,25 @@ if (runTime.outputTime()) { allSpeciesN_RU = List< scalarField > ( - molecules.nIds(), + molecules.pairPotentials().nIds(), scalarField (mesh.nCells(), 0.0) ); allSpeciesM_RU = List< scalarField > ( - molecules.nIds(), + molecules.pairPotentials().nIds(), scalarField (mesh.nCells(), 0.0) ); allSpeciesVelocitySum_RU = List< vectorField > ( - molecules.nIds(), + molecules.pairPotentials().nIds(), vectorField (mesh.nCells(), vector::zero) ); allSpeciesVelocityMagSquaredSum_RU = List< scalarField > ( - molecules.nIds(), + molecules.pairPotentials().nIds(), scalarField (mesh.nCells(), 0.0) ); } diff --git a/src/lagrangian/molecule/mdTools/temperatureAndPressure.H b/src/lagrangian/molecularDynamics/molecule/mdTools/temperatureAndPressure.H old mode 100755 new mode 100644 similarity index 97% rename from src/lagrangian/molecule/mdTools/temperatureAndPressure.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/temperatureAndPressure.H index 0563700cb7..0ae8b5d1ea --- a/src/lagrangian/molecule/mdTools/temperatureAndPressure.H +++ b/src/lagrangian/molecularDynamics/molecule/mdTools/temperatureAndPressure.H @@ -86,6 +86,8 @@ if (runTime.outputTime()) << " m/s" << nl << "Average temperature = " << averageTemperature << " K" << nl + << "accumulatedTotalrDotfSum = " + << accumulatedTotalrDotfSum << nl << "Average pressure = " << averagePressure << " N/m^2" << nl << "----------------------------------------" << endl; diff --git a/src/lagrangian/molecule/mdTools/temperatureAndPressureVariables.H b/src/lagrangian/molecularDynamics/molecule/mdTools/temperatureAndPressureVariables.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/mdTools/temperatureAndPressureVariables.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/temperatureAndPressureVariables.H diff --git a/src/lagrangian/molecule/mdTools/temperatureEquilibration.H b/src/lagrangian/molecularDynamics/molecule/mdTools/temperatureEquilibration.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/mdTools/temperatureEquilibration.H rename to src/lagrangian/molecularDynamics/molecule/mdTools/temperatureEquilibration.H diff --git a/src/lagrangian/molecule/molecule/molecule.C b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C old mode 100755 new mode 100644 similarity index 99% rename from src/lagrangian/molecule/molecule/molecule.C rename to src/lagrangian/molecularDynamics/molecule/molecule/molecule.C index 0a46a0ca2c..0bf2c95b67 --- a/src/lagrangian/molecule/molecule/molecule.C +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.C @@ -54,7 +54,7 @@ bool molecule::move(molecule::trackData& td) U_ += 0.5*deltaT*A_; } - while (td.keepParticle && !td.switchProcessor && tEnd > SMALL) + while (td.keepParticle && !td.switchProcessor && tEnd > (SMALL*SMALL)) { // set the lagrangian time-step scalar dt = min(dtMax, tEnd); @@ -178,6 +178,7 @@ void molecule::hitWallPatch { U_ -= 2*Un*nw; } + // } } diff --git a/src/lagrangian/molecule/molecule/molecule.H b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H old mode 100755 new mode 100644 similarity index 99% rename from src/lagrangian/molecule/molecule/molecule.H rename to src/lagrangian/molecularDynamics/molecule/molecule/molecule.H index a3e2099589..cbc0a7a134 --- a/src/lagrangian/molecule/molecule/molecule.H +++ b/src/lagrangian/molecularDynamics/molecule/molecule/molecule.H @@ -23,10 +23,9 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::molecule + molecule Description - Foam::molecule SourceFiles moleculeI.H @@ -192,6 +191,7 @@ public: //- Return tetherPosition inline const vector& tetherPosition() const; + inline vector& tetherPosition(); //- Tracking diff --git a/src/lagrangian/molecule/molecule/moleculeI.H b/src/lagrangian/molecularDynamics/molecule/molecule/moleculeI.H old mode 100755 new mode 100644 similarity index 74% rename from src/lagrangian/molecule/molecule/moleculeI.H rename to src/lagrangian/molecularDynamics/molecule/molecule/moleculeI.H index bfbda044b1..c9f1b9eb73 --- a/src/lagrangian/molecule/molecule/moleculeI.H +++ b/src/lagrangian/molecularDynamics/molecule/molecule/moleculeI.H @@ -24,9 +24,12 @@ License \*---------------------------------------------------------------------------*/ +namespace Foam +{ + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -inline Foam::molecule::molecule +inline molecule::molecule ( const Cloud& c, const vector& position, @@ -51,7 +54,7 @@ inline Foam::molecule::molecule {} -inline Foam::molecule::trackData::trackData +inline molecule::trackData::trackData ( moleculeCloud& molCloud, label part @@ -65,88 +68,98 @@ inline Foam::molecule::trackData::trackData // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::label Foam::molecule::id() const +inline label molecule::id() const { return id_; } -inline Foam::scalar Foam::molecule::mass() const +inline scalar molecule::mass() const { return mass_; } -inline const Foam::vector& Foam::molecule::U() const +inline const vector& molecule::U() const { return U_; } -inline Foam::vector& Foam::molecule::U() +inline vector& molecule::U() { return U_; } -inline const Foam::vector& Foam::molecule::A() const +inline const vector& molecule::A() const { return A_; } -inline Foam::vector& Foam::molecule::A() +inline vector& molecule::A() { return A_; } -inline Foam::scalar Foam::molecule::potentialEnergy() const +inline scalar molecule::potentialEnergy() const { return potentialEnergy_; } -inline Foam::scalar& Foam::molecule::potentialEnergy() +inline scalar& molecule::potentialEnergy() { return potentialEnergy_; } -inline const Foam::tensor& Foam::molecule::rf() const +inline const tensor& molecule::rf() const { return rf_; } -inline Foam::tensor& Foam::molecule::rf() +inline tensor& molecule::rf() { return rf_; } -inline Foam::label Foam::molecule::tethered() const +inline label molecule::tethered() const { return tethered_; } -inline const Foam::vector& Foam::molecule::tetherPosition() const +inline const vector& molecule::tetherPosition() const { return tetherPosition_; } -inline Foam::moleculeCloud& Foam::molecule::trackData::molCloud() +inline vector& molecule::tetherPosition() +{ + return tetherPosition_; +} + + +inline moleculeCloud& molecule::trackData::molCloud() { return molCloud_; } -inline Foam::label Foam::molecule::trackData::part() const +inline label molecule::trackData::part() const { return part_; } +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + // ************************************************************************* // diff --git a/src/lagrangian/molecule/molecule/moleculeIO.C b/src/lagrangian/molecularDynamics/molecule/molecule/moleculeIO.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/molecule/moleculeIO.C rename to src/lagrangian/molecularDynamics/molecule/molecule/moleculeIO.C diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloud.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloud.H b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.H old mode 100755 new mode 100644 similarity index 94% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloud.H rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.H index 37d8cf22bb..600c874346 --- a/src/lagrangian/molecule/moleculeCloud/moleculeCloud.H +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.H @@ -97,18 +97,6 @@ private: scalar potentialEnergyLimit_; - scalar guardRadius_; - - scalar rCutMax_; - - //- storing rCutMaxSqr in class as well as rCutMax to - //- avoid needing to calculate it often. - //- Possibilty of inconsistency if tinkered with. - - scalar rCutMaxSqr_; - - List idList_; - labelList removalOrder_; labelListList directInteractionList_; @@ -189,20 +177,10 @@ public: inline scalar potentialEnergyLimit() const; - inline scalar guardRadius() const; - - inline scalar rCutMax() const; - - inline scalar rCutMaxSqr() const; - - inline const List& idList() const; - inline const labelList& removalOrder() const; inline label nPairPotentials() const; - inline label nIds() const; - inline const labelListList& directInteractionList() const; inline const referredCellList& referredInteractionList() const; diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudApplyConstraintsAndThermostats.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudApplyConstraintsAndThermostats.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudApplyConstraintsAndThermostats.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudApplyConstraintsAndThermostats.C diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildCellInteractionLists.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildCellInteractionLists.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildCellInteractionLists.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildCellInteractionLists.C diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildCellOccupancy.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildCellOccupancy.C old mode 100755 new mode 100644 similarity index 89% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildCellOccupancy.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildCellOccupancy.C index f02be61f7e..89ad6cd3e6 --- a/src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildCellOccupancy.C +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildCellOccupancy.C @@ -22,13 +22,21 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +Class + moleculeCloud + +Description + \*----------------------------------------------------------------------------*/ #include "moleculeCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -void Foam::moleculeCloud::buildCellOccupancy() +namespace Foam +{ + +void moleculeCloud::buildCellOccupancy() { forAll(cellOccupancy_, cO) { @@ -37,7 +45,12 @@ void Foam::moleculeCloud::buildCellOccupancy() iterator mol(this->begin()); - for (mol = this->begin(); mol != this->end(); ++mol) + for + ( + mol = this->begin(); + mol != this->end(); + ++mol + ) { cellOccupancy_[mol().cell()].append(&mol()); } @@ -50,5 +63,6 @@ void Foam::moleculeCloud::buildCellOccupancy() referredInteractionList_.referMolecules(); } +} // End namespace Foam // ************************************************************************* // diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildCellReferralLists.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildCellReferralLists.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildCellReferralLists.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildCellReferralLists.C diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildDirectInteractionList.H b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildDirectInteractionList.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildDirectInteractionList.H rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildDirectInteractionList.H diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildReferredInteractionList.H b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildReferredInteractionList.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudBuildReferredInteractionList.H rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudBuildReferredInteractionList.H diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculateExternalForce.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculateExternalForce.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculateExternalForce.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculateExternalForce.C diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculateForce.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculateForce.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculateForce.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculateForce.C diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForce.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForce.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForce.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForce.C diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCells.H b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCells.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCells.H rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCells.H diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCellsCalculationStep.H b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCellsCalculationStep.H old mode 100755 new mode 100644 similarity index 92% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCellsCalculationStep.H rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCellsCalculationStep.H index 49e1e2d781..9f2080d02e --- a/src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCellsCalculationStep.H +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForceRealCellsCalculationStep.H @@ -6,7 +6,7 @@ rIJ = molI->position() - molJ->position(); rIJMagSq = magSqr(rIJ); -if (pairPotentials_.rCutSqr(idI, idJ, rIJMagSq)) +if(pairPotentials_.rCutSqr(idI, idJ, rIJMagSq)) { rIJMag = mag(rIJ); diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForceReferredCells.H b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForceReferredCells.H old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculatePairForceReferredCells.H rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculatePairForceReferredCells.H diff --git a/src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculateTetherForce.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculateTetherForce.C old mode 100755 new mode 100644 similarity index 100% rename from src/lagrangian/molecule/moleculeCloud/moleculeCloudCalculateTetherForce.C rename to src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCalculateTetherForce.C diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCodeSnippets.H b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCodeSnippets.H new file mode 100644 index 0000000000..a66b409b45 --- /dev/null +++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloudCodeSnippets.H @@ -0,0 +1,193 @@ +// Parallel coding to access boundary information to build up interaction cell info + +// See preservePatchTypes for how to read the boundary file. + +// Read faceProcAddressing, as per reconstructPar, to get hold of the original, +// undecomposed face label from a face on a processor mesh. See email from Mattijs: + +// > Is it a case of reading the faceProcAddressing file, in the same way as +// > something like reconstructPar? +// Correct. +// +// Note that faceProcAddressing is a bit weird since it also includes which side +// of an internal face we have. If I remember correctly: +// +// faceI == 0 illegal +// faceI > 0 we have the original owner of  faceI-1 i.e. we have the face in the +// original order. +// faceI < 0 we have the original neighbour of -faceI-1 so the face is flipped. + +// Use the same functionality as +// label polyBoundaryMesh::whichPatch(const label faceIndex) const +// To determine which patch a face was on originally. + +if (Pstream::parRun()) +{ +// if (Pstream::myProcNo() == Pstream::masterNo()) +// // { +// dictionary patchDictionary; +// +// DynamicList patchNames; +// +// { +// IOobject undecomposedBoundaryHeader +// ( +// "undecomposedBoundary", +// mesh_.time().constant(), +// polyMesh::meshSubDir, +// mesh_, +// IOobject::MUST_READ, +// IOobject::NO_WRITE, +// false +// ); +// +// if (undecomposedBoundaryHeader.headerOk()) +// { +// polyBoundaryMeshEntries undecomposedPatchEntries +// ( +// undecomposedBoundaryHeader +// ); +// +// forAll(undecomposedPatchEntries, patchi) +// { +// patchNames.append +// ( +// undecomposedPatchEntries[patchi].keyword() +// ); +// +// patchDictionary.add +// ( +// undecomposedPatchEntries[patchi] +// ); +// } +// } +// else +// { +// FatalErrorIn +// ( +// "moleculeCloudBuildCellInteractionLists.C\n" +// ) +// << "undecomposedBoundary file not found in " +// "constant/polyMesh" +// << abort(FatalError); +// } +// } +// +// labelIOList faceProcAddressing +// ( +// IOobject +// ( +// "faceProcAddressing", +// mesh_.time().constant(), +// polyMesh::meshSubDir, +// mesh_, +// IOobject::MUST_READ, +// IOobject::NO_WRITE, +// false +// ) +// ); + + labelList procPatches(mesh_.globalData().processorPatches()); + + forAll(procPatches,pP) + { + const processorPolyPatch& patch = + refCast + ( + mesh_.boundaryMesh()[procPatches[pP]] + ); +// +// Pout << nl << "name: " << patch.name() << nl +// << "start: " << patch.start() << nl +// << "size: " << patch.size() << nl +// << "separated: " << Switch(patch.separated()) << nl +// << "parallel: " << Switch(patch.parallel()) << nl << endl; +// +// forAll (patch, pI) +// { +// label decomposedMeshFace = patch.start() + pI; +// +// label faceProcAdd = faceProcAddressing[decomposedMeshFace]; +// +// label globalFace = abs(faceProcAdd)-1; +// +// Pout << "Patch index: " << pI +// << " " << patch[pI] +// << " Mesh index: " << decomposedMeshFace +// << " faceProcAdd: " << faceProcAdd +// << " globalFace:" << globalFace; +// +// label minStart = -1; +// +// // Scanning the dictionary each time is a very ugly way of +// // finding out what patch a face originally belonged to, but +// // it proves the concept. Read the patch info a container +// // class and have a neat way of tell which patch a face is from +// // embedded in that. Split each processor face down into +// // separate lists for each different originiating patch. +// +// forAll(patchNames, patchi) +// { +// if (patchDictionary.found(patchNames[patchi])) +// { +// const dictionary& patchDict = +// patchDictionary.subDict(patchNames[patchi]); +// +// word faceName(patchNames[patchi]); +// label startFace(readLabel(patchDict.lookup("startFace"))); +// label nFaces(readLabel(patchDict.lookup("nFaces"))); +// +// if +// ( +// minStart < 0 +// || startFace < minStart +// ) +// { +// minStart = startFace; +// } +// +// if +// ( +// globalFace >= startFace +// && globalFace < startFace + nFaces +// ) +// { +// Pout << " original patch: " << faceName << endl; +// } +// } +// } +// +// if (globalFace < minStart) +// { +// Pout << " originally an internal face" << endl; +// } +// } +// + if (patch.separated()) + { + Pout << patch.separation(); + } + + if (!patch.parallel()) + { + Pout << patch.forwardT(); + } + } +// } +// else +// { +// +// } + + // Get coords of my shared points +// vector sharedPoints(vector::one*(Pstream::myProcNo()+1)); +// label testRedLab(Pstream::myProcNo()+1); + +// Pout << testRedLab << endl; + + // Append from all processors +// combineReduce(sharedPoints, plusEqOp()); +// reduce(testRedLab, plusOp