diff --git a/applications/solvers/lagrangian/reactingParcelFoam/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/LTSReactingParcelFoam/LTSReactingParcelFoam.C index 0841d458b41a1597173f5172812ac2296dfbe197..fabb0bba6090f482877f029a4e97cab13fad88a2 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -59,7 +59,6 @@ int main(int argc, char *argv[]) pimpleControl pimple(mesh); #include "readTimeControls.H" - #include "readAdditionalSolutionControls.H" #include "createFields.H" #include "createRDeltaT.H" #include "createRadiationModel.H" @@ -74,7 +73,6 @@ int main(int argc, char *argv[]) while (runTime.run()) { - #include "readAdditionalSolutionControls.H" #include "readTimeControls.H" runTime++; diff --git a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H index 8ef6c610dd4b32377284fc14099e53d836ede6f6..a22267d9be2706d4bcc01fc2562436e41b567c64 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/YEqn.H @@ -9,11 +9,9 @@ tmp<fv::convectionScheme<scalar> > mvConvection ) ); -combustion->correct(); -dQ = combustion->dQ(); - -if (solveSpecies) { + combustion->correct(); + dQ = combustion->dQ(); label inertIndex = -1; volScalarField Yt(0.0*Y[0]); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C index d1c735f658f59c830523a38684c8810eb481171e..8ef6838c597de6b67c85ee7175f0a64643f44319 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFoam/reactingParcelFoam.C @@ -78,7 +78,6 @@ int main(int argc, char *argv[]) while (runTime.run()) { #include "readTimeControls.H" - #include "readAdditionalSolutionControls.H" #include "compressibleCourantNo.H" #include "setDeltaT.H" diff --git a/applications/solvers/lagrangian/reactingParcelFoam/readAdditionalSolutionControls.H b/applications/solvers/lagrangian/reactingParcelFoam/readAdditionalSolutionControls.H deleted file mode 100644 index d04dfc406d1e0c43c8171200e58f2fd36258f752..0000000000000000000000000000000000000000 --- a/applications/solvers/lagrangian/reactingParcelFoam/readAdditionalSolutionControls.H +++ /dev/null @@ -1,4 +0,0 @@ -dictionary additional = mesh.solutionDict().subDict("additional"); - -// flag to activate solve transport for each specie (Y vector) -bool solveSpecies = additional.lookupOrDefault("solveSpecies", true); diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/sprayEngineFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/sprayEngineFoam.C index 06ed6e1c2bbf9c839180c3fd357d6e8d88c7fc3c..1b4f46289fc47944ded482c15f62e95ed66f06c7 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/sprayEngineFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/sprayEngineFoam.C @@ -60,7 +60,6 @@ int main(int argc, char *argv[]) #include "startSummary.H" pimpleControl pimple(mesh); - bool solveSpecies = true; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C index 78713032f3c9ec99da2bb52d5bbd9cd186cf18c9..02739bda71d304101f85f9336aa05d17124a0c05 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayFoam.C +++ b/applications/solvers/lagrangian/sprayFoam/sprayFoam.C @@ -57,7 +57,6 @@ int main(int argc, char *argv[]) #include "setInitialDeltaT.H" pimpleControl pimple(mesh); - bool solveSpecies = true; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/etc/config/settings.csh b/etc/config/settings.csh index 0896420bccdb364672bd5d45471c433e18ae4ca5..069624f513770e59da28f60cf8aadb975c5d82b8 100644 --- a/etc/config/settings.csh +++ b/etc/config/settings.csh @@ -151,16 +151,18 @@ setenv FOAM_LIBBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib # external (ThirdParty) libraries setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib -# shared site executables/libraries -# similar naming convention as ~OpenFOAM expansion +# site-specific directory if ( $?WM_PROJECT_SITE ) then - setenv FOAM_SITE_APPBIN $WM_PROJECT_SITE/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin - setenv FOAM_SITE_LIBBIN $WM_PROJECT_SITE/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib + set siteDir=$WM_PROJECT_SITE else - setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin - setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib + set siteDir=$WM_PROJECT_INST_DIR/site endif +# shared site executables/libraries +# similar naming convention as ~OpenFOAM expansion +setenv FOAM_SITE_APPBIN $siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin +setenv FOAM_SITE_LIBBIN $siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib + # user executables/libraries setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib @@ -182,6 +184,15 @@ if ( -d "${WM_DIR}" ) setenv PATH ${WM_DIR}:${PATH} # add OpenFOAM scripts to the path setenv PATH ${WM_PROJECT_DIR}/bin:${PATH} +# add site-specific scripts to path - only if they exist +if ( -d "$siteDir/bin" ) then # generic + _foamAddPath "$siteDir/bin" +endif +if ( -d "$siteDir/$WM_PROJECT_VERSION/bin" ) then # version-specific + _foamAddPath "$siteDir/$WM_PROJECT_VERSION/bin" +endif +unset siteDir + _foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN} # Make sure to pick up dummy versions of external libraries last _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_LIBBIN}:${FOAM_LIBBIN}/dummy diff --git a/etc/config/settings.sh b/etc/config/settings.sh index 1a7e8237f9da1b45abb08e70adc8ccab3ac13852..1fc2136530a5374a4d9cc3d9f8955c8858dbb91f 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -179,16 +179,13 @@ export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib # external (ThirdParty) libraries export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_OPTIONS/lib +# site-specific directory +siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_INST_DIR/site}" + # shared site executables/libraries # similar naming convention as ~OpenFOAM expansion -if [ -n "$WM_PROJECT_SITE" ] -then - export FOAM_SITE_APPBIN=$WM_PROJECT_SITE/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin - export FOAM_SITE_LIBBIN=$WM_PROJECT_SITE/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib -else - export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin - export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib -fi +export FOAM_SITE_APPBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin +export FOAM_SITE_LIBBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib # user executables/libraries export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin @@ -211,6 +208,17 @@ export FOAM_RUN=$WM_PROJECT_USER_DIR/run # add OpenFOAM scripts to the path export PATH=$WM_PROJECT_DIR/bin:$PATH +# add site-specific scripts to path - only if they exist +if [ -d "$siteDir/bin" ] # generic +then + _foamAddPath "$siteDir/bin" +fi +if [ -d "$siteDir/$WM_PROJECT_VERSION/bin" ] # version-specific +then + _foamAddPath "$siteDir/$WM_PROJECT_VERSION/bin" +fi +unset siteDir + _foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN # Make sure to pick up dummy versions of external libraries last _foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$FOAM_LIBBIN/dummy @@ -232,6 +240,12 @@ fi case "${foamCompiler}" in OpenFOAM | ThirdParty) case "$WM_COMPILER" in + Gcc463) + gcc_version=gcc-4.6.3 + gmp_version=gmp-5.0.2 + mpfr_version=mpfr-3.0.1 + mpc_version=mpc-0.9 + ;; Gcc | Gcc++0x | Gcc46 | Gcc46++0x) gcc_version=gcc-4.6.1 gmp_version=gmp-5.0.4 diff --git a/src/Allwmake b/src/Allwmake index a61c7a2e3e28a4b4f90763fc505c67785dd5f72f..94afb0d9855672992449aaf02e4080bdbf440fd5 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -67,7 +67,6 @@ turbulenceModels/Allwmake $* wmake $makeType combustionModels regionModels/Allwmake $* lagrangian/Allwmake $* -postProcessing/Allwmake $* mesh/Allwmake $* fvAgglomerationMethods/Allwmake $* @@ -77,4 +76,6 @@ wmake $makeType engine wmake $makeType fieldSources +postProcessing/Allwmake $* + # ----------------------------------------------------------------- end-of-file diff --git a/src/fieldSources/basicSource/basicSource/basicSourceList.C b/src/fieldSources/basicSource/basicSource/basicSourceList.C index 819d7b8f6baf6c51322db7f4c35352d352ff2e72..2d484868a44c969dd66d9539e07fa08d206c0b40 100644 --- a/src/fieldSources/basicSource/basicSource/basicSourceList.C +++ b/src/fieldSources/basicSource/basicSource/basicSourceList.C @@ -62,6 +62,22 @@ Foam::basicSourceList::basicSourceList PtrList<basicSource>(), mesh_(mesh), checkTimeIndex_(mesh_.time().startTimeIndex() + 2) +{ + reset(dict); +} + + +Foam::basicSourceList::basicSourceList(const fvMesh& mesh) +: + PtrList<basicSource>(), + mesh_(mesh), + checkTimeIndex_(mesh_.time().startTimeIndex() + 2) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::basicSourceList::reset(const dictionary& dict) { label count = 0; forAllConstIter(dictionary, dict, iter) @@ -85,15 +101,13 @@ Foam::basicSourceList::basicSourceList this->set ( i++, - basicSource::New(name, sourceDict, mesh) + basicSource::New(name, sourceDict, mesh_) ); } } } -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - bool Foam::basicSourceList::read(const dictionary& dict) { checkTimeIndex_ = mesh_.time().timeIndex() + 2; diff --git a/src/fieldSources/basicSource/basicSource/basicSourceList.H b/src/fieldSources/basicSource/basicSource/basicSourceList.H index 7d77de55d12b284cf7fde37abbed53b0f8a9fbd3..6a7a0126ed49d126775285fd9ecd0b6a6717ad23 100644 --- a/src/fieldSources/basicSource/basicSource/basicSourceList.H +++ b/src/fieldSources/basicSource/basicSource/basicSourceList.H @@ -84,7 +84,10 @@ public: // Constructors - //- Construct from components with list of field names + //- Construct null + basicSourceList(const fvMesh& mesh); + + //- Construct from mesh and dictionary basicSourceList(const fvMesh& mesh, const dictionary& dict); @@ -95,6 +98,9 @@ public: // Member Functions + //- Reset the source list + void reset(const dictionary& dict); + //- Correct template<class Type> void correct(GeometricField<Type, fvPatchField, volMesh>& fld); diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C index 0cd882fe5463391e6c22fa1715279e7563232e0c..d83681cba132ed8d27c8f74399a37633da972a08 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C @@ -65,6 +65,15 @@ Foam::solverPerformance Foam::fvMatrix<Type>::solve << endl; } + label maxIter = -1; + if (solverControls.readIfPresent("maxIter", maxIter)) + { + if (maxIter == 0) + { + return solverPerformance(); + } + } + word type(solverControls.lookupOrDefault<word>("type", "segregated")); if (type == "segregated") diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index ff2f3a6e8413631f1ab77f893d9e2935a09dd4a7..32473b8acf1a35d2c875205f87bdae1b687f45b5 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -585,16 +585,23 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td) pPtr->rho() ); - if ((pPtr->nParticle() >= 1.0) && (pPtr->move(td, dt))) + if (!pPtr->move(td, dt)) { - td.cloud().addParticle(pPtr); - massAdded += pPtr->nParticle()*pPtr->mass(); - parcelsAdded++; + delete pPtr; } else { - delayedVolume += pPtr->nParticle()*pPtr->volume(); - delete pPtr; + if (pPtr->nParticle() >= 1.0) + { + td.cloud().addParticle(pPtr); + massAdded += pPtr->nParticle()*pPtr->mass(); + parcelsAdded++; + } + else + { + delayedVolume += pPtr->nParticle()*pPtr->volume(); + delete pPtr; + } } } } diff --git a/src/postProcessing/functionObjects/IO/Make/files b/src/postProcessing/functionObjects/IO/Make/files index 8aeea600e4fd0300edad8a59d90bbd62f3d7b5cc..95065c4b3f863d798f70ba46038e15621990ad98 100644 --- a/src/postProcessing/functionObjects/IO/Make/files +++ b/src/postProcessing/functionObjects/IO/Make/files @@ -4,6 +4,9 @@ partialWrite/partialWriteFunctionObject.C removeRegisteredObject/removeRegisteredObject.C removeRegisteredObject/removeRegisteredObjectFunctionObject.C +writeDictionary/writeDictionary.C +writeDictionary/writeDictionaryFunctionObject.C + writeRegisteredObject/writeRegisteredObject.C writeRegisteredObject/writeRegisteredObjectFunctionObject.C diff --git a/src/postProcessing/functionObjects/utilities/pressureCoefficient/IOpressureCoefficient.H b/src/postProcessing/functionObjects/IO/writeDictionary/IOwriteDictionary.H similarity index 84% rename from src/postProcessing/functionObjects/utilities/pressureCoefficient/IOpressureCoefficient.H rename to src/postProcessing/functionObjects/IO/writeDictionary/IOwriteDictionary.H index 120fcc007c858064dc22dfb67574f578fdeaa30a..87718cd6dcbbf55f229586dd68bdffbf5e2155c2 100644 --- a/src/postProcessing/functionObjects/utilities/pressureCoefficient/IOpressureCoefficient.H +++ b/src/postProcessing/functionObjects/IO/writeDictionary/IOwriteDictionary.H @@ -22,24 +22,24 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Typedef - Foam::IOpressureCoefficient + Foam::IOwriteDictionary Description - Instance of the generic IOOutputFilter for pressureCoefficient. + Instance of the generic IOOutputFilter for writeDictionary. \*---------------------------------------------------------------------------*/ -#ifndef IOpressureCoefficient_H -#define IOpressureCoefficient_H +#ifndef IOwriteDictionary_H +#define IOwriteDictionary_H -#include "pressureCoefficient.H" +#include "writeDictionary.H" #include "IOOutputFilter.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IOOutputFilter<pressureCoefficient> IOpressureCoefficient; + typedef IOOutputFilter<writeDictionary> IOwriteDictionary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C new file mode 100644 index 0000000000000000000000000000000000000000..f10a84eece70d01301a635d07d21d1b7a4fbd651 --- /dev/null +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.C @@ -0,0 +1,199 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "writeDictionary.H" +#include "dictionary.H" +#include "Time.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::writeDictionary, 0); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +bool Foam::writeDictionary::tryFolder +( + const label dictI, + const word& location, + bool& firstDict +) +{ + IOobject dictIO + ( + dictNames_[dictI], + location, + obr_, + IOobject::MUST_READ + ); + + if (dictIO.headerOk()) + { + IOdictionary dict(dictIO); + + if (dict.digest() != digests_[dictI]) + { + if (firstDict) + { + Info<< type() << " output:" << nl << endl; + + IOobject::writeDivider(Info); + Info<< endl; + firstDict = false; + } + + Info<< dict.dictName() << dict << nl; + + IOobject::writeDivider(Info); + + digests_[dictI] = dict.digest(); + } + + return true; + } + + return false; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::writeDictionary::writeDictionary +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + dictNames_(), + digests_() +{ + read(dict); + + execute(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::writeDictionary::~writeDictionary() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::writeDictionary::read(const dictionary& dict) +{ + dict.lookup("dictNames") >> dictNames_; + + digests_.setSize(dictNames_.size(), SHA1Digest()); + + Info<< type() << ": monitoring dictionaries:" << nl; + if (dictNames_.size()) + { + forAll(dictNames_, i) + { + Info<< " " << dictNames_[i] << endl; + } + } + else + { + Info<< " none" << nl; + } + Info<< endl; +} + + +void Foam::writeDictionary::execute() +{ + bool firstDict = true; + forAll(dictNames_, i) + { + if (obr_.foundObject<dictionary>(dictNames_[i])) + { + const dictionary& dict = + obr_.lookupObject<dictionary>(dictNames_[i]); + + if (dict.digest() != digests_[i]) + { + if (firstDict) + { + Info<< type() << " output:" << nl << endl; + + IOobject::writeDivider(Info); + Info<< endl; + firstDict = false; + } + + digests_[i] = dict.digest(); + + Info<< dict.dictName() << dict << nl; + IOobject::writeDivider(Info); + Info<< endl; + } + } + else + { + bool processed = tryFolder(i, obr_.time().timeName(), firstDict); + + if (!processed) + { + processed = tryFolder(i, obr_.time().constant(), firstDict); + } + + if (!processed) + { + processed = tryFolder(i, obr_.time().system(), firstDict); + } + + if (!processed) + { + Info<< " Unable to locate dictionary " << dictNames_[i] + << nl << endl; + } + else + { + Info<< endl; + } + } + } +} + + +void Foam::writeDictionary::end() +{ + // do nothing +} + + +void Foam::writeDictionary::write() +{ + // do nothing +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.H b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H similarity index 70% rename from src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.H rename to src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H index 34e1a0fda67aaed7846208bc56929e689f0df5b1..fb7a2952fd1276522d76543a2eceac64652ac476 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.H +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionary.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,24 +22,24 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::staticPressure + Foam::writeDictionary Description - Converts kinematic pressure to static pressure, from the name of the - pressure field, and density, i.e. - - p_static = density*p_kinematic + This function object writes dictionaries on start-up, and on change SourceFiles - staticPressure.C - IOstaticPressure.H + writeDictionary.C + IOwriteDictionary.H \*---------------------------------------------------------------------------*/ -#ifndef staticPressure_H -#define staticPressure_H +#ifndef writeDictionary_H +#define writeDictionary_H #include "pointFieldFwd.H" +#include "wordList.H" +#include "runTimeSelectionTables.H" +#include "SHA1Digest.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,51 +52,56 @@ class dictionary; class mapPolyMesh; /*---------------------------------------------------------------------------*\ - Class staticPressure Declaration + Class writeDictionary Declaration \*---------------------------------------------------------------------------*/ -class staticPressure +class writeDictionary { +protected: + // Private data - //- Name of this set of staticPressure objects + //- Name of this set of writeDictionary word name_; + //- Reference to the database const objectRegistry& obr_; - //- on/off switch - bool active_; - - //- Name of pressure field, default is "p" - word pName_; + //- Names of dictionaries to monitor + wordList dictNames_; - //- Density value - scalar rho_; + //- List of changed dictionaries (only those registered to database) + List<SHA1Digest> digests_; // Private Member Functions - //- Return true if the pressure field corresponds to kinematic pressure - bool isKinematicPressure(); + //- Helper function to write the dictionary if found at location + bool tryFolder + ( + const label dictI, + const word& location, + bool& firstDict + ); //- Disallow default bitwise copy construct - staticPressure(const staticPressure&); + writeDictionary(const writeDictionary&); //- Disallow default bitwise assignment - void operator=(const staticPressure&); + void operator=(const writeDictionary&); public: //- Runtime type information - TypeName("staticPressure"); + TypeName("writeDictionary"); // Constructors //- Construct for given objectRegistry and dictionary. // Allow the possibility to load fields from files - staticPressure + writeDictionary ( const word& name, const objectRegistry&, @@ -106,18 +111,18 @@ public: //- Destructor - virtual ~staticPressure(); + virtual ~writeDictionary(); // Member Functions - //- Return name of the set of staticPressure + //- Return name of the writeDictionary virtual const word& name() const { return name_; } - //- Read the staticPressure data + //- Read the writeDictionary data virtual void read(const dictionary&); //- Execute, currently does nothing @@ -126,7 +131,7 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); - //- Calculate the staticPressure and write + //- Write the writeDictionary virtual void write(); //- Update for changes of mesh diff --git a/src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficientFunctionObject.C b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionaryFunctionObject.C similarity index 89% rename from src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficientFunctionObject.C rename to src/postProcessing/functionObjects/IO/writeDictionary/writeDictionaryFunctionObject.C index 7d75af07f0cffe76dc05263ebbf17347e9a9365f..712e7d9b39704b5d83bca4fe22931ea0e2497527 100644 --- a/src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficientFunctionObject.C +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionaryFunctionObject.C @@ -23,18 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "pressureCoefficientFunctionObject.H" +#include "writeDictionaryFunctionObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineNamedTemplateTypeNameAndDebug(pressureCoefficientFunctionObject, 0); + defineNamedTemplateTypeNameAndDebug(writeDictionaryFunctionObject, 0); addToRunTimeSelectionTable ( functionObject, - pressureCoefficientFunctionObject, + writeDictionaryFunctionObject, dictionary ); } diff --git a/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionaryFunctionObject.H b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionaryFunctionObject.H new file mode 100644 index 0000000000000000000000000000000000000000..2f53fd5d2e9a1190f5991b68325c5cf1271a74ba --- /dev/null +++ b/src/postProcessing/functionObjects/IO/writeDictionary/writeDictionaryFunctionObject.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::writeDictionaryFunctionObject + +Description + FunctionObject wrapper around writeDictionary to allow them to be + created via the functions entry within controlDict. + +SourceFiles + writeDictionaryFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef writeDictionaryFunctionObject_H +#define writeDictionaryFunctionObject_H + +#include "writeDictionary.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject<writeDictionary> + writeDictionaryFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C index cf76cbda0ef9e562b823f24de3a47aa546cfed5f..cfde19724890b8fcbc4d4da1b319c569a73a71c3 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C @@ -96,7 +96,7 @@ void Foam::fieldMinMax::calcMinMaxFields } fieldMinMaxFilePtr_() - << token::TAB << maxValue << token::TAB << maxC; + << token::TAB << maxValue << token::TAB << maxC; if (Pstream::parRun()) { diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index 6ce7b3350ddb4e5eac90b3bc8338ece4e6504e78..600d3d9ecdc505d573b6a863de5cfb624b8d77ec 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -29,6 +29,8 @@ License #include "emptyPolyPatch.H" #include "coupledPolyPatch.H" #include "sampledSurface.H" +#include "mergePoints.H" +#include "indirectPrimitivePatch.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -222,6 +224,127 @@ void Foam::fieldValues::faceSource::sampledSurfaceFaces(const dictionary& dict) } +void Foam::fieldValues::faceSource::combineSurfaceGeometry +( + faceList& faces, + pointField& points +) const +{ + List<faceList> allFaces(Pstream::nProcs()); + List<pointField> allPoints(Pstream::nProcs()); + + labelList globalFacesIs(faceId_); + forAll(globalFacesIs, i) + { + if (facePatchId_[i] != -1) + { + label patchI = facePatchId_[i]; + globalFacesIs[i] += mesh().boundaryMesh()[patchI].start(); + } + } + + // Add local faces and points to the all* lists + indirectPrimitivePatch pp + ( + IndirectList<face>(mesh().faces(), globalFacesIs), + mesh().points() + ); + allFaces[Pstream::myProcNo()] = pp.localFaces(); + allPoints[Pstream::myProcNo()] = pp.localPoints(); + + Pstream::gatherList(allFaces); + Pstream::gatherList(allPoints); + + // Renumber and flatten + label nFaces = 0; + label nPoints = 0; + forAll(allFaces, procI) + { + nFaces += allFaces[procI].size(); + nPoints += allPoints[procI].size(); + } + + faces.setSize(nFaces); + points.setSize(nPoints); + + nFaces = 0; + nPoints = 0; + + // My own data first + { + const faceList& fcs = allFaces[Pstream::myProcNo()]; + forAll(fcs, i) + { + const face& f = fcs[i]; + face& newF = faces[nFaces++]; + newF.setSize(f.size()); + forAll(f, fp) + { + newF[fp] = f[fp] + nPoints; + } + } + + const pointField& pts = allPoints[Pstream::myProcNo()]; + forAll(pts, i) + { + points[nPoints++] = pts[i]; + } + } + + // Other proc data follows + forAll(allFaces, procI) + { + if (procI != Pstream::myProcNo()) + { + const faceList& fcs = allFaces[procI]; + forAll(fcs, i) + { + const face& f = fcs[i]; + face& newF = faces[nFaces++]; + newF.setSize(f.size()); + forAll(f, fp) + { + newF[fp] = f[fp] + nPoints; + } + } + + const pointField& pts = allPoints[procI]; + forAll(pts, i) + { + points[nPoints++] = pts[i]; + } + } + } + + // Merge + labelList oldToNew; + pointField newPoints; + bool hasMerged = mergePoints + ( + points, + SMALL, + false, + oldToNew, + newPoints + ); + + if (hasMerged) + { + if (debug) + { + Pout<< "Merged from " << points.size() + << " down to " << newPoints.size() << " points" << endl; + } + + points.transfer(newPoints); + forAll(faces, i) + { + inplaceRenumber(oldToNew, faces[i]); + } + } +} + + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::fieldValues::faceSource::initialise(const dictionary& dict) @@ -291,6 +414,14 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict) } Info<< nl << endl; + + if (valueOutput_) + { + surfaceWriterPtr_.reset + ( + surfaceWriter::New(dict.lookup("surfaceFormat")).ptr() + ); + } } @@ -355,6 +486,7 @@ Foam::fieldValues::faceSource::faceSource ) : fieldValue(name, obr, dict, loadFromFiles), + surfaceWriterPtr_(NULL), source_(sourceTypeNames_.read(dict.lookup("source"))), operation_(operationTypeNames_.read(dict.lookup("operation"))), weightFieldName_("none"), diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index fd95788894aa3e9d63ebc083045e422f66d6164c..c4473b352a8209921d1381805fe17c005e554db1 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H @@ -35,9 +35,10 @@ Description enabled true; outputControl outputTime; log true; // log to screen? - valueOutput true; // Write values at run-time output times? - source faceZone; // Type of face source: - // faceZone,patch,sampledSurface + valueOutput true; // write the output values + surfaceFormat none; // output value format (if valueOutput) + source faceZone; // type of face source: + // faceZone, patch, sampledSurface sourceName f0; // faceZone name, see below operation sum; weightField alpha1; // optional weight field @@ -97,6 +98,7 @@ SourceFiles #include "fieldValue.H" #include "surfaceFieldsFwd.H" #include "volFieldsFwd.H" +#include "surfaceWriter.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -166,11 +168,21 @@ private: //- Set faces according to sampledSurface void sampledSurfaceFaces(const dictionary&); + //- Combine faces and points from multiple processors + void combineSurfaceGeometry + ( + faceList& faces, + pointField& points + ) const; + protected: // Protected data + //- Surface writer + autoPtr<surfaceWriter> surfaceWriterPtr_; + //- Source type sourceType source_; @@ -184,7 +196,7 @@ protected: label nFaces_; - // If operating on mesh faces (faceZone,patch) + // If operating on mesh faces (faceZone, patch) //- Local list of face IDs labelList faceId_; @@ -196,6 +208,7 @@ protected: // (1 use as is, -1 negate) labelList faceSign_; + // If operating on sampledSurface //- underlying sampledSurface diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C index 450ac18d91db2ec9a305de6b83938b6679318e49..cfdcc08d4fb39214a1d88d8ca8d0a712cb4a07d2 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C @@ -254,31 +254,46 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName) combineFields(Sf); combineFields(weightField); + // Write raw values on surface if specified + if (surfaceWriterPtr_.valid()) + { + faceList faces; + pointField points; + combineSurfaceGeometry(faces, points); + + fileName outputDir; + if (Pstream::parRun()) + { + // Put in undecomposed case (Note: gives problems for + // distributed data running) + outputDir = obr_.time().path()/".."/name_; + } + else + { + outputDir = obr_.time().path()/name_; + } + + outputDir = outputDir/"surface"/obr_.time().timeName(); + + surfaceWriterPtr_->write + ( + outputDir, + word(sourceTypeNames_[source_]) + "_" + sourceName_, + points, + faces, + fieldName, + values, + false + ); + } + // apply weight field values *= weightField; - if (Pstream::master()) { Type result = processValues(values, Sf, weightField); - if (valueOutput_) - { - IOField<Type> - ( - IOobject - ( - fieldName + "_" + sourceTypeNames_[source_] + "-" - + sourceName_, - obr_.time().timeName(), - obr_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - values - ).write(); - } - outputFilePtr_()<< tab << result; if (log_) diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C index d01d17e986c6179c3f0eb352f434d16ab6b51a57..90f6a3a4e978c394dd12d896c4686ad85d07a12c 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ License #include "dictionary.H" #include "Time.H" #include "Pstream.H" +#include "IOmanip.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -89,7 +90,8 @@ void Foam::forceCoeffs::writeFileHeader() if (forcesFilePtr_.valid()) { forcesFilePtr_() - << "# Time" << tab << "Cd" << tab << "Cl" << tab << "Cm" << endl; + << "# Time" << tab << "Cm" << tab << "Cd" << tab << "Cl" << tab + << "Cl(f)" << "Cl(r)" << endl; } } @@ -112,37 +114,77 @@ void Foam::forceCoeffs::write() { // Create the forces file if not already created makeFile(); + forces::calcForcesMoment(); - forcesMoments fm = forces::calcForcesMoment(); + if (Pstream::master()) + { + scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_; - scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_; + Field<vector> totForce(force_[0] + force_[1]); + Field<vector> totMoment(moment_[0] + moment_[1]); - vector totForce = fm.first().first() + fm.first().second(); - vector totMoment = fm.second().first() + fm.second().second(); + List<Field<scalar> > coeffs(3); + coeffs[0].setSize(nBin_); + coeffs[1].setSize(nBin_); + coeffs[2].setSize(nBin_); - scalar liftForce = totForce & liftDir_; - scalar dragForce = totForce & dragDir_; - scalar pitchMoment = totMoment & pitchAxis_; + // lift, drag and moment + coeffs[0] = (totForce & liftDir_)/(Aref_*pDyn); + coeffs[1] = (totForce & dragDir_)/(Aref_*pDyn); + coeffs[2] = (totMoment & pitchAxis_)/(Aref_*lRef_*pDyn); - scalar Cl = liftForce/(Aref_*pDyn); - scalar Cd = dragForce/(Aref_*pDyn); - scalar Cm = pitchMoment/(Aref_*lRef_*pDyn); + scalar Cl = sum(coeffs[0]); + scalar Cd = sum(coeffs[1]); + scalar Cm = sum(coeffs[2]); + + scalar Clf = Cl/2.0 - Cm; + scalar Clr = Cl/2.0 + Cm; - if (Pstream::master()) - { forcesFilePtr_() << obr_.time().value() << tab - << Cd << tab << Cl << tab << Cm << endl; + << Cm << tab << Cd << tab << Cl << tab << Clf << tab << Clr + << endl; if (log_) { - Info<< "forceCoeffs output:" << nl + Info<< type() << " output:" << nl << " Cm = " << Cm << nl << " Cd = " << Cd << nl << " Cl = " << Cl << nl - << " Cl(f) = " << Cl/2.0 - Cm << nl - << " Cl(r) = " << Cl/2.0 + Cm << nl - << endl; + << " Cl(f) = " << Clf << nl + << " Cl(r) = " << Clr << endl; + } + + if (nBin_ > 1) + { + autoPtr<writer<scalar> > + binWriterPtr(writer<scalar>::New(binFormat_)); + wordList fieldNames(IStringStream("(lift drag moment)")()); + + coordSet axis + ( + "forceCoeffs", + "distance", + binPoints_, + mag(binPoints_) + ); + + fileName forcesDir = + baseFileDir()/"bins"/obr_.time().timeName(); + mkDir(forcesDir); + + if (log_) + { + Info<< " Writing bins to " << forcesDir << endl; + } + + OFstream osCoeffs(forcesDir/"forceCoeffs"); + binWriterPtr->write(axis, fieldNames, coeffs, osCoeffs); + } + + if (log_) + { + Info<< endl; } } } diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H index 59c064c407615a3855e37bfcfc6416c5e47d04d7..1eb8db01af9384d5fc6dd835306ffcf0d1800ad4 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,7 @@ Class Description Derived from the forces function object, creates a specialisation to - calculate lift and drag forces. + calculate lift, drag and moment coefficients. SourceFiles forceCoeffs.C @@ -81,6 +81,12 @@ class forceCoeffs scalar Aref_; + // Bin information + + //- Writer for bin data + autoPtr<writer<scalar> > binWriterPtr_; + + // Private Member Functions //- Disallow default bitwise copy construct diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index cf835d66ef607f78889ed8e01a97783bd069e1a5..318e732b317939b95e3e11be185a85f5002f8091 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -43,7 +43,78 @@ License defineTypeNameAndDebug(Foam::forces, 0); -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +Foam::fileName Foam::forces::baseFileDir() const +{ + fileName baseDir; + + if (Pstream::parRun()) + { + // Put in undecomposed case (Note: gives problems for + // distributed data running) + baseDir = obr_.time().path()/".."/name_; + } + else + { + baseDir = obr_.time().path()/name_; + } + + return baseDir; +} + + +void Foam::forces::makeFile() +{ + // Create the forces file if not already created + if (forcesFilePtr_.empty()) + { + if (debug) + { + Info<< "Creating forces file" << endl; + } + + // File update + if (Pstream::master()) + { + word startTimeName = + obr_.time().timeName(obr_.time().startTime().value()); + + fileName forcesDir = baseFileDir()/startTimeName; + + // Create directory if does not exist. + mkDir(forcesDir); + + // Open new file at start up + forcesFilePtr_.reset(new OFstream(forcesDir/(type() + ".dat"))); + + // Add headers to output data + writeFileHeader(); + } + } +} + + +void Foam::forces::writeFileHeader() +{ + if (forcesFilePtr_.valid()) + { + forcesFilePtr_() + << "# Time" << tab + << "forces(pressure, viscous) moment(pressure, viscous)"; + + if (localSystem_) + { + forcesFilePtr_() + << tab + << "local forces(pressure, viscous) " + << "local moment(pressure, viscous)"; + } + + forcesFilePtr_()<< endl; + } +} + Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const { @@ -167,6 +238,85 @@ Foam::scalar Foam::forces::rho(const volScalarField& p) const } +void Foam::forces::applyBins +( + const label patchI, + const vectorField fN, + const vectorField Md, + const vectorField fT +) +{ + if (nBin_ == 1) + { + force_[0][0] = sum(fN); + force_[1][0] = sum(fT); + moment_[0][0] = sum(Md ^ fN); + moment_[1][0] = sum(Md ^ fT); + } + else + { + const fvMesh& mesh = refCast<const fvMesh>(obr_); + const vectorField& Cf = mesh.C().boundaryField()[patchI]; + scalarField d((Cf & binDir_) - binMin_); + + forAll(d, i) + { + label binI = floor(d[i]/binDx_); + force_[0][binI] += fN[i]; + force_[1][binI] += fT[i]; + moment_[0][binI] += Md[i]^fN[i]; + moment_[1][binI] += Md[i]^fT[i]; + } + } +} + + +void Foam::forces::writeBins() const +{ + if (nBin_ == 1) + { + return; + } + + autoPtr<writer<vector> > binWriterPtr(writer<vector>::New(binFormat_)); + coordSet axis("forces", "distance", binPoints_, mag(binPoints_)); + + fileName forcesDir = baseFileDir()/"bins"/obr_.time().timeName(); + mkDir(forcesDir); + + if (log_) + { + Info<< " Writing bins to " << forcesDir << endl; + + } + + wordList fieldNames(IStringStream("(pressure viscous)")()); + + OFstream osForce(forcesDir/"force"); + binWriterPtr->write(axis, fieldNames, force_, osForce); + + OFstream osMoment(forcesDir/"moment"); + binWriterPtr->write(axis, fieldNames, moment_, osMoment); + + + if (localSystem_) + { + List<Field<vector> > localForce(2); + List<Field<vector> > localMoment(2); + localForce[0] = coordSys_.localVector(force_[0]); + localForce[1] = coordSys_.localVector(force_[1]); + localMoment[0] = coordSys_.localVector(moment_[0]); + localMoment[1] = coordSys_.localVector(moment_[1]); + + OFstream osLocalForce(forcesDir/"force_local"); + binWriterPtr->write(axis, fieldNames, localForce, osLocalForce); + + OFstream osLocalMoment(forcesDir/"moment_local"); + binWriterPtr->write(axis, fieldNames, localMoment, osLocalMoment); + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::forces::forces @@ -181,6 +331,8 @@ Foam::forces::forces obr_(obr), active_(true), log_(false), + force_(2), + moment_(2), patchSet_(), pName_(word::null), UName_(word::null), @@ -191,6 +343,12 @@ Foam::forces::forces pRef_(0), coordSys_(), localSystem_(false), + nBin_(1), + binDir_(vector::zero), + binDx_(0.0), + binMin_(GREAT), + binPoints_(), + binFormat_("undefined"), forcesFilePtr_(NULL) { // Check if the available mesh is an fvMesh otherise deactivate @@ -231,6 +389,8 @@ Foam::forces::forces obr_(obr), active_(true), log_(false), + force_(2), + moment_(2), patchSet_(patchSet), pName_(pName), UName_(UName), @@ -241,6 +401,12 @@ Foam::forces::forces pRef_(pRef), coordSys_(coordSys), localSystem_(false), + nBin_(1), + binDir_(vector::zero), + binDx_(0.0), + binMin_(GREAT), + binPoints_(), + binFormat_("undefined"), forcesFilePtr_(NULL) {} @@ -261,11 +427,9 @@ void Foam::forces::read(const dictionary& dict) directForceDensity_ = dict.lookupOrDefault("directForceDensity", false); const fvMesh& mesh = refCast<const fvMesh>(obr_); + const polyBoundaryMesh& pbm = mesh.boundaryMesh(); - patchSet_ = mesh.boundaryMesh().patchSet - ( - wordReList(dict.lookup("patches")) - ); + patchSet_ = pbm.patchSet(wordReList(dict.lookup("patches"))); if (directForceDensity_) { @@ -334,68 +498,77 @@ void Foam::forces::read(const dictionary& dict) coordSys_ = coordinateSystem(dict, obr_); localSystem_ = true; } - } -} - - -void Foam::forces::makeFile() -{ - // Create the forces file if not already created - if (forcesFilePtr_.empty()) - { - if (debug) - { - Info<< "Creating forces file." << endl; - } - // File update - if (Pstream::master()) + // read bin information if present + if (dict.readIfPresent<label>("nBin", nBin_)) { - fileName forcesDir; - word startTimeName = - obr_.time().timeName(obr_.time().startTime().value()); - - if (Pstream::parRun()) + if (nBin_ < 0) { - // Put in undecomposed case (Note: gives problems for - // distributed data running) - forcesDir = obr_.time().path()/".."/name_/startTimeName; + FatalIOErrorIn + ( + "void Foam::forces::read(const dictionary&)", dict + ) << "Number of bins (nBin) must be zero or greater" + << exit(FatalIOError); } - else + else if ((nBin_ == 0) || (nBin_ == 1)) { - forcesDir = obr_.time().path()/name_/startTimeName; + nBin_ = 1; + force_[0].setSize(1); + force_[1].setSize(1); + moment_[0].setSize(1); + moment_[1].setSize(1); } - // Create directory if does not exist. - mkDir(forcesDir); + if (nBin_ > 1) + { + dict.lookup("binDir") >> binDir_; + binDir_ /= mag(binDir_); - // Open new file at start up - forcesFilePtr_.reset(new OFstream(forcesDir/(type() + ".dat"))); + binMin_ = GREAT; + scalar binMax = -GREAT; + forAllConstIter(labelHashSet, patchSet_, iter) + { + label patchI = iter.key(); + const polyPatch& pp = pbm[patchI]; + scalarField d(pp.faceCentres() & binDir_); + binMin_ = min(min(d), binMin_); + binMax = max(max(d), binMax); + } + reduce(binMin_, minOp<scalar>()); + reduce(binMax, maxOp<scalar>()); - // Add headers to output data - writeFileHeader(); - } - } -} + // slightly boost binMax so that region of interest is fully + // within bounds + binMax = 1.0001*(binMax - binMin_) + binMin_; + binDx_ = (binMax - binMin_)/scalar(nBin_); -void Foam::forces::writeFileHeader() -{ - if (forcesFilePtr_.valid()) - { - forcesFilePtr_() - << "# Time" << tab - << "forces(pressure, viscous) moment(pressure, viscous)"; + // create the bin points used for writing + binPoints_.setSize(nBin_); + forAll(binPoints_, i) + { + binPoints_[i] = (i + 0.5)*binDir_*binDx_; + } - if (localSystem_) - { - forcesFilePtr_() - << tab - << "local forces(pressure, viscous) " - << "local moment(pressure, viscous)"; + dict.lookup("binFormat") >> binFormat_; + + // allocate storage for forces and moments + forAll(force_, i) + { + force_[i].setSize(nBin_); + moment_[i].setSize(nBin_); + } + } } - forcesFilePtr_()<< endl; + if (nBin_ == 1) + { + // allocate storage for forces and moments + force_[0].setSize(1); + force_[1].setSize(1); + moment_[0].setSize(1); + moment_[1].setSize(1); + } } } @@ -414,71 +587,65 @@ void Foam::forces::end() void Foam::forces::write() { - if (active_) + if (!active_) { - // Create the forces file if not already created - makeFile(); - - forcesMoments fm = calcForcesMoment(); - - if (Pstream::master()) - { - if (log_) - { - Info<< "forces output:" << nl - << " forces(pressure, viscous)" << fm.first() << nl - << " moment(pressure, viscous)" << fm.second() << nl; - } - - forcesFilePtr_() << obr_.time().value() << tab << fm; - - if (localSystem_) - { - forcesMoments fmLocal; - - fmLocal.first().first() = - coordSys_.localVector(fm.first().first()); - - fmLocal.first().second() = - coordSys_.localVector(fm.first().second()); + return; + } - fmLocal.second().first() = - coordSys_.localVector(fm.second().first()); + // Create the forces file if not already created + makeFile(); - fmLocal.second().second() = - coordSys_.localVector(fm.second().second()); + calcForcesMoment(); - forcesFilePtr_() << tab << fmLocal; + if (Pstream::master()) + { + if (log_) + { + Info<< type() << " output:" << nl + << " forces(pressure,viscous)" + << "(" << sum(force_[0]) << "," << sum(force_[1]) << ")" << nl + << " moment(pressure,viscous)" + << "(" << sum(moment_[0]) << "," << sum(moment_[1]) << ")" + << nl; + } - if (log_) - { - Info<< " local:" << nl - << " forces(pressure, viscous)" << fmLocal.first() - << nl - << " moment(pressure, viscous)" << fmLocal.second() - << nl; - } - } + forcesFilePtr_() << obr_.time().value() << tab + << "(" << sum(force_[0]) << "," << sum(force_[1]) << ") " + << "(" << sum(moment_[0]) << "," << sum(moment_[1]) << ")" + << endl; + if (localSystem_) + { + vectorField localForceP(coordSys_.localVector(force_[0])); + vectorField localForceV(coordSys_.localVector(force_[1])); + vectorField localMomentP(coordSys_.localVector(moment_[0])); + vectorField localMomentV(coordSys_.localVector(moment_[1])); + + forcesFilePtr_() << obr_.time().value() << tab + << "(" << sum(localForceP) << "," << sum(localForceV) << ") " + << "(" << sum(localMomentP) << "," << sum(localMomentV) << ")" + << endl; + } - forcesFilePtr_() << endl; + writeBins(); - if (log_) - { - Info<< endl; - } + if (log_) + { + Info<< endl; } + + forcesFilePtr_() << endl; } } -Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const +void Foam::forces::calcForcesMoment() { - forcesMoments fm - ( - pressureViscous(vector::zero, vector::zero), - pressureViscous(vector::zero, vector::zero) - ); + force_[0] = vector::zero; + force_[1] = vector::zero; + + moment_[0] = vector::zero; + moment_[1] = vector::zero; if (directForceDensity_) { @@ -491,32 +658,28 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const forAllConstIter(labelHashSet, patchSet_, iter) { - label patchi = iter.key(); + label patchI = iter.key(); vectorField Md ( - mesh.C().boundaryField()[patchi] - coordSys_.origin() + mesh.C().boundaryField()[patchI] - coordSys_.origin() ); - scalarField sA(mag(Sfb[patchi])); + scalarField sA(mag(Sfb[patchI])); - // Normal force = surfaceUnitNormal * (surfaceNormal & forceDensity) + // Normal force = surfaceUnitNormal*(surfaceNormal & forceDensity) vectorField fN ( - Sfb[patchi]/sA + Sfb[patchI]/sA *( - Sfb[patchi] & fD.boundaryField()[patchi] + Sfb[patchI] & fD.boundaryField()[patchI] ) ); - fm.first().first() += sum(fN); - fm.second().first() += sum(Md ^ fN); - // Tangential force (total force minus normal fN) - vectorField fT(sA*fD.boundaryField()[patchi] - fN); + vectorField fT(sA*fD.boundaryField()[patchI] - fN); - fm.first().second() += sum(fT); - fm.second().second() += sum(Md ^ fT); + applyBins(patchI, fN, Md, fT); } } else @@ -538,28 +701,38 @@ Foam::forces::forcesMoments Foam::forces::calcForcesMoment() const forAllConstIter(labelHashSet, patchSet_, iter) { - label patchi = iter.key(); + label patchI = iter.key(); vectorField Md ( - mesh.C().boundaryField()[patchi] - coordSys_.origin() + mesh.C().boundaryField()[patchI] - coordSys_.origin() ); - vectorField pf(Sfb[patchi]*(p.boundaryField()[patchi] - pRef)); - - fm.first().first() += rho(p)*sum(pf); - fm.second().first() += rho(p)*sum(Md ^ pf); + vectorField pf + ( + rho(p)*Sfb[patchI]*(p.boundaryField()[patchI] - pRef) + ); - vectorField vf(Sfb[patchi] & devRhoReffb[patchi]); + vectorField vf(Sfb[patchI] & devRhoReffb[patchI]); - fm.first().second() += sum(vf); - fm.second().second() += sum(Md ^ vf); + applyBins(patchI, pf, Md, vf); } } - reduce(fm, sumOp()); + Pstream::listCombineGather(force_, plusEqOp<vectorField>()); + Pstream::listCombineGather(moment_, plusEqOp<vectorField>()); +} + - return fm; +Foam::vector Foam::forces::forceEff() const +{ + return sum(force_[0]) + sum(force_[1]); +} + + +Foam::vector Foam::forces::momentEff() const +{ + return sum(moment_[0]) + sum(moment_[1]); } diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index 3d14768b2b8a7b2f8ac9f4a63fea6c48367d2cb8..d5a74b9ec7cfff3071d3612ff97cdec1c0880eb2 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,6 +31,13 @@ Description Member function forces::write() calculates the forces/moments and writes the forces/moments into the file \<timeDir\>/forces.dat + The data can optionally be collected into bins, using e.g. + \verbaitim + nBin 20; // output data into bins + binDir (1 0 0); // bin direction + binFormat gnuplot; + \endverbatim + Note The centre of rotation for moment calculations can either be specified by an \c CofR entry, or be taken from origin of the local coordinateSystem. @@ -66,6 +73,7 @@ SourceFiles #include "OFstream.H" #include "Switch.H" #include "pointFieldFwd.H" +#include "writer.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -83,46 +91,9 @@ class mapPolyMesh; class forces { -public: - - // Tuple for pressure (.first()) and viscous (.second()) forces - typedef Tuple2<vector, vector> pressureViscous; - - // Tuple for forces (.first()) and moment (.second()) - // pressure/viscous forces Tuples. - typedef Tuple2<pressureViscous, pressureViscous> forcesMoments; - - //- Sum operation class to accumulate pressure/viscous forces and moments - class sumOp - { - public: - - forcesMoments operator() - ( - const forcesMoments& fm1, - const forcesMoments& fm2 - ) const - { - return forcesMoments - ( - pressureViscous - ( - fm1.first().first() + fm2.first().first(), - fm1.first().second() + fm2.first().second() - ), - pressureViscous - ( - fm1.second().first() + fm2.second().first(), - fm1.second().second() + fm2.second().second() - ) - ); - } - }; - - protected: - // Private data + // Protected data //- Name of this set of forces, // Also used as the name of the probes directory. @@ -130,12 +101,19 @@ protected: const objectRegistry& obr_; - //- on/off switch + //- On/off switch bool active_; //- Switch to send output to Info as well as to file Switch log_; + //- Pressure and viscous force per bin + List<Field<vector> > force_; + + //- Pressure and viscous pressure per bin + List<Field<vector> > moment_; + + // Read from dictionary //- Patches to integrate forces over @@ -169,11 +147,35 @@ protected: bool localSystem_; + // Bin information + + //- Number of bins + label nBin_; + + //- Direction used to determine bin orientation + vector binDir_; + + //- Distance between bin divisions + scalar binDx_; + + //- Minimum bin bounds + scalar binMin_; + + //- Bin positions along binDir + List<point> binPoints_; + + //- Write format for bin data + word binFormat_; + + //- Forces/moment file ptr autoPtr<OFstream> forcesFilePtr_; - // Private Member Functions + // Protected Member Functions + + //- Return the base file directory for output + fileName baseFileDir() const; //- If the forces file has not been created create it void makeFile(); @@ -191,6 +193,18 @@ protected: // otherwise return 1 scalar rho(const volScalarField& p) const; + //- Accumulate bin data + void applyBins + ( + const label patchI, + const vectorField fN, + const vectorField Md, + const vectorField fT + ); + + //- Helper function to write bin data + void writeBins() const; + //- Disallow default bitwise copy construct forces(const forces&); @@ -256,8 +270,14 @@ public: //- Write the forces virtual void write(); - //- Calculate and return forces and moment - virtual forcesMoments calcForcesMoment() const; + //- Calculate the forces and moments + virtual void calcForcesMoment(); + + //- Return the total force + virtual vector forceEff() const; + + //- Return the total moment + virtual vector momentEff() const; //- Update for changes of mesh virtual void updateMesh(const mapPolyMesh&) diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C index 351e5120def54fb6a0e04e58fef5dc32a381657c..fb15396f0f40b2031f4ab1d30beba7909a7b0226 100644 --- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C +++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C @@ -218,7 +218,7 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs() forces f("forces", db(), forcesDict); - forces::forcesMoments fm = f.calcForcesMoment(); + f.calcForcesMoment(); // Get the forces on the patch faces at the current positions @@ -232,8 +232,8 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs() motion_.updateForce ( - fm.first().first() + fm.first().second() + g_*motion_.mass(), - fm.second().first() + fm.second().second(), + f.forceEff() + g_*motion_.mass(), + f.momentEff(), t.deltaTValue() ); diff --git a/src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficient.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C similarity index 59% rename from src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficient.C rename to src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C index b4d1e30c87598b66769131787405f64d7b360e5a..538fb1040d32a312c417857c3d86db668faac372 100644 --- a/src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficient.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.C @@ -23,25 +23,28 @@ License \*---------------------------------------------------------------------------*/ -#include "pressureCoefficient.H" +#include "CourantNo.H" #include "volFields.H" +#include "surfaceFields.H" #include "dictionary.H" +#include "zeroGradientFvPatchFields.H" +#include "fvcSurfaceIntegrate.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(Foam::pressureCoefficient, 0); +defineTypeNameAndDebug(Foam::CourantNo, 0); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -Foam::tmp<Foam::volScalarField> Foam::pressureCoefficient::rho +Foam::tmp<Foam::volScalarField> Foam::CourantNo::rho ( - const volScalarField& p + const surfaceScalarField& phi ) const { - if (p.dimensions() == dimPressure) + if (phi.dimensions() == dimMass/dimTime) { - return(obr_.lookupObject<volScalarField>(rhoName_)); + return (obr_.lookupObject<volScalarField>(rhoName_)); } else { @@ -67,7 +70,7 @@ Foam::tmp<Foam::volScalarField> Foam::pressureCoefficient::rho // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::pressureCoefficient::pressureCoefficient +Foam::CourantNo::CourantNo ( const word& name, const objectRegistry& obr, @@ -78,9 +81,8 @@ Foam::pressureCoefficient::pressureCoefficient name_(name), obr_(obr), active_(true), - pName_("p"), - rhoName_("rho"), - magUinf_(0.0) + phiName_("phi"), + rhoName_("rho") { // Check if the available mesh is an fvMesh, otherwise deactivate if (!isA<fvMesh>(obr_)) @@ -88,7 +90,7 @@ Foam::pressureCoefficient::pressureCoefficient active_ = false; WarningIn ( - "pressureCoefficient::pressureCoefficient" + "CourantNo::CourantNo" "(" "const word&, " "const objectRegistry&, " @@ -100,60 +102,94 @@ Foam::pressureCoefficient::pressureCoefficient } read(dict); + + if (active_) + { + const fvMesh& mesh = refCast<const fvMesh>(obr_); + + volScalarField* CourantNoPtr + ( + new volScalarField + ( + IOobject + ( + type(), + mesh.time().timeName(), + mesh, + IOobject::NO_READ + ), + mesh, + dimensionedScalar("0", dimless, 0.0), + zeroGradientFvPatchScalarField::typeName + ) + ); + + mesh.objectRegistry::store(CourantNoPtr); + } } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::pressureCoefficient::~pressureCoefficient() +Foam::CourantNo::~CourantNo() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::pressureCoefficient::read(const dictionary& dict) +void Foam::CourantNo::read(const dictionary& dict) { if (active_) { - pName_ = dict.lookupOrDefault<word>("pName", "p"); + phiName_ = dict.lookupOrDefault<word>("phiName", "phi"); rhoName_ = dict.lookupOrDefault<word>("rhoName", "rho"); - - dict.lookup("magUinf") >> magUinf_; } } -void Foam::pressureCoefficient::execute() +void Foam::CourantNo::execute() { // Do nothing - only valid on write } -void Foam::pressureCoefficient::end() +void Foam::CourantNo::end() { // Do nothing - only valid on write } -void Foam::pressureCoefficient::write() +void Foam::CourantNo::write() { if (active_) { - const volScalarField& p = obr_.lookupObject<volScalarField>(pName_); + const fvMesh& mesh = refCast<const fvMesh>(obr_); - volScalarField pressureCoefficient - ( - IOobject + const surfaceScalarField& phi = + mesh.lookupObject<surfaceScalarField>(phiName_); + + volScalarField& CourantNo = + const_cast<volScalarField&> ( - "pressureCoefficient", - obr_.time().timeName(), - obr_, - IOobject::NO_READ - ), - p/(0.5*rho(p)*sqr(magUinf_)) + mesh.lookupObject<volScalarField>(type()) + ); + + scalarField& iField = CourantNo.internalField(); + + const scalarField sumPhi + ( + fvc::surfaceSum(mag(phi))().internalField() + /rho(phi)().internalField() ); - pressureCoefficient.write(); + iField = 0.5*sumPhi/mesh.V().field()*mesh.time().deltaTValue(); + + CourantNo.correctBoundaryConditions(); + + CourantNo.write(); + + Info<< type() << " output:" << nl + << " writing " << CourantNo.name() << "field" << nl << endl; } } diff --git a/src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficient.H b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H similarity index 73% rename from src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficient.H rename to src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H index 7d72e3b7842fa36eb4d7622230188261696c481b..d1235f446f91465436cbd8920f965f126f40aab4 100644 --- a/src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficient.H +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNo.H @@ -22,28 +22,27 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::pressureCoefficient + Foam::CourantNo Description - Calculates pressure coefficient, c_p - - c_p = p/p_dyn,inf - - where: - - p_dyn,inf = 0.5*rho*mag(U_inf)^2 + This function object calculates and outputs the Courant number as a + volScalarField. The field is stored on the mesh database so that it can + be retrieved and used for other applications. SourceFiles - pressureCoefficient.C - IOpressureCoefficient.H + CourantNo.C + IOCourantNo.H \*---------------------------------------------------------------------------*/ -#ifndef pressureCoefficient_H -#define pressureCoefficient_H +#ifndef CourantNo_H +#define CourantNo_H #include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" #include "pointFieldFwd.H" +#include "OFstream.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -56,55 +55,53 @@ class dictionary; class mapPolyMesh; /*---------------------------------------------------------------------------*\ - Class pressureCoefficient Declaration + Class CourantNo Declaration \*---------------------------------------------------------------------------*/ -class pressureCoefficient +class CourantNo { // Private data - //- Name of this set of pressureCoefficient objects + //- Name of this set of CourantNo objects word name_; + //- Reference to the database const objectRegistry& obr_; - //- on/off switch + //- On/off switch bool active_; - //- Name of pressure field, default is "p" - word pName_; + //- Name of flux field, default is "phi" + word phiName_; //- Name of density field (optional) word rhoName_; - //- Free stream velocity magnitude [m/s] - scalar magUinf_; - // Private Member Functions - //- Return 1 if the pressure field is kinematic, i.e. p/rho - // otherwise return rho from database - tmp<volScalarField> rho(const volScalarField& p) const; + //- Return 1 if the flux field is volumetric, otherwise return rho + // from the database + tmp<volScalarField> rho(const surfaceScalarField& p) const; //- Disallow default bitwise copy construct - pressureCoefficient(const pressureCoefficient&); + CourantNo(const CourantNo&); //- Disallow default bitwise assignment - void operator=(const pressureCoefficient&); + void operator=(const CourantNo&); public: //- Runtime type information - TypeName("pressureCoefficient"); + TypeName("CourantNo"); // Constructors //- Construct for given objectRegistry and dictionary. // Allow the possibility to load fields from files - pressureCoefficient + CourantNo ( const word& name, const objectRegistry&, @@ -114,18 +111,18 @@ public: //- Destructor - virtual ~pressureCoefficient(); + virtual ~CourantNo(); // Member Functions - //- Return name of the set of pressureCoefficient + //- Return name of the set of CourantNo virtual const word& name() const { return name_; } - //- Read the pressureCoefficient data + //- Read the CourantNo data virtual void read(const dictionary&); //- Execute, currently does nothing @@ -134,7 +131,7 @@ public: //- Execute at the final time-loop, currently does nothing virtual void end(); - //- Calculate the pressureCoefficient and write + //- Calculate the CourantNo and write virtual void write(); //- Update for changes of mesh diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.C b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNoFunctionObject.C similarity index 86% rename from src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.C rename to src/postProcessing/functionObjects/utilities/CourantNo/CourantNoFunctionObject.C index 1cd5007cba527d7d8a78dc37a4194a968c43cd18..af57c73e67596ac9e9eaaf86a4f0416767a69cac 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.C +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNoFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,18 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "staticPressureFunctionObject.H" +#include "CourantNoFunctionObject.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - defineNamedTemplateTypeNameAndDebug(staticPressureFunctionObject, 0); + defineNamedTemplateTypeNameAndDebug(CourantNoFunctionObject, 0); addToRunTimeSelectionTable ( functionObject, - staticPressureFunctionObject, + CourantNoFunctionObject, dictionary ); } diff --git a/src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficientFunctionObject.H b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNoFunctionObject.H similarity index 79% rename from src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficientFunctionObject.H rename to src/postProcessing/functionObjects/utilities/CourantNo/CourantNoFunctionObject.H index d658646e96b22abc200bcf3ef13db1d7773d0eea..1586e771abdd78d3e69e461223ec65942054cb2e 100644 --- a/src/postProcessing/functionObjects/utilities/pressureCoefficient/pressureCoefficientFunctionObject.H +++ b/src/postProcessing/functionObjects/utilities/CourantNo/CourantNoFunctionObject.H @@ -22,29 +22,28 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Typedef - Foam::pressureCoefficientFunctionObject + Foam::CourantNoFunctionObject Description - FunctionObject wrapper around pressureCoefficient to allow it to be created + FunctionObject wrapper around CourantNo to allow it to be created via the functions entry within controlDict. SourceFiles - pressureCoefficientFunctionObject.C + CourantNoFunctionObject.C \*---------------------------------------------------------------------------*/ -#ifndef pressureCoefficientFunctionObject_H -#define pressureCoefficientFunctionObject_H +#ifndef CourantNoFunctionObject_H +#define CourantNoFunctionObject_H -#include "pressureCoefficient.H" +#include "CourantNo.H" #include "OutputFilterFunctionObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef OutputFilterFunctionObject<pressureCoefficient> - pressureCoefficientFunctionObject; + typedef OutputFilterFunctionObject<CourantNo> CourantNoFunctionObject; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/IOstaticPressure.H b/src/postProcessing/functionObjects/utilities/CourantNo/IOCourantNo.H similarity index 82% rename from src/postProcessing/functionObjects/utilities/staticPressure/IOstaticPressure.H rename to src/postProcessing/functionObjects/utilities/CourantNo/IOCourantNo.H index a2e41e3d0d567c11f28e24288fa46674fad2c8b4..5be7eb4eb9f764bfb846ebfcb90a5539d8eeddbe 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/IOstaticPressure.H +++ b/src/postProcessing/functionObjects/utilities/CourantNo/IOCourantNo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,24 +22,24 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Typedef - Foam::IOstaticPressure + Foam::IOCourantNo Description - Instance of the generic IOOutputFilter for staticPressure. + Instance of the generic IOOutputFilter for CourantNo. \*---------------------------------------------------------------------------*/ -#ifndef IOstaticPressure_H -#define IOstaticPressure_H +#ifndef IOCourantNo_H +#define IOCourantNo_H -#include "staticPressure.H" +#include "CourantNo.H" #include "IOOutputFilter.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef IOOutputFilter<staticPressure> IOstaticPressure; + typedef IOOutputFilter<CourantNo> IOCourantNo; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/postProcessing/functionObjects/utilities/Make/files b/src/postProcessing/functionObjects/utilities/Make/files index f6e23536e04cac814f1357c7f2890267b76d82d8..d5a78589b2fa13a72a42aa49b84babae6c3bb13e 100644 --- a/src/postProcessing/functionObjects/utilities/Make/files +++ b/src/postProcessing/functionObjects/utilities/Make/files @@ -1,17 +1,23 @@ codedFunctionObject/codedFunctionObject.C +CourantNo/CourantNo.C +CourantNo/CourantNoFunctionObject.C + dsmcFields/dsmcFields.C dsmcFields/dsmcFieldsFunctionObject.C -pressureCoefficient/pressureCoefficient.C -pressureCoefficient/pressureCoefficientFunctionObject.C +pressureTools/pressureTools.C +pressureTools/pressureToolsFunctionObject.C -staticPressure/staticPressure.C -staticPressure/staticPressureFunctionObject.C +scalarTransport/scalarTransport.C +scalarTransport/scalarTransportFunctionObject.C timeActivatedFileUpdate/timeActivatedFileUpdate.C timeActivatedFileUpdate/timeActivatedFileUpdateFunctionObject.C +wallShearStress/wallShearStress.C +wallShearStress/wallShearStressFunctionObject.C + yPlusLES/yPlusLES.C yPlusLES/yPlusLESFunctionObject.C diff --git a/src/postProcessing/functionObjects/utilities/Make/options b/src/postProcessing/functionObjects/utilities/Make/options index 61713e09134be2aac6a3f6db5eeb15df2d08953b..38f9d8a3a07c45599068eb6e7d96d01e32e5bbfc 100644 --- a/src/postProcessing/functionObjects/utilities/Make/options +++ b/src/postProcessing/functionObjects/utilities/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/dsmc/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ @@ -13,6 +14,7 @@ EXE_INC = \ LIB_LIBS = \ -lfiniteVolume \ + -lfieldSources \ -lmeshTools \ -lsampling \ -llagrangian \ diff --git a/src/postProcessing/functionObjects/utilities/pressureTools/IOpressureTools.H b/src/postProcessing/functionObjects/utilities/pressureTools/IOpressureTools.H new file mode 100644 index 0000000000000000000000000000000000000000..4d10f447209725030c82cbb79d85aa4e423e274c --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/pressureTools/IOpressureTools.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::IOpressureTools + +Description + Instance of the generic IOOutputFilter for pressureTools. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOpressureTools_H +#define IOpressureTools_H + +#include "pressureTools.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter<pressureTools> IOpressureTools; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C similarity index 50% rename from src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C rename to src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C index aa2b4ebab387ba5a28fdf039d748cca13a24dc25..6d70be969a2fe6caad71d16a572890783a28a747 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressure.C +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,28 +23,119 @@ License \*---------------------------------------------------------------------------*/ -#include "staticPressure.H" +#include "pressureTools.H" #include "volFields.H" #include "dictionary.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(Foam::staticPressure, 0); +defineTypeNameAndDebug(Foam::pressureTools, 0); // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -bool Foam::staticPressure::isKinematicPressure() +Foam::word Foam::pressureTools::pName() const { - const volScalarField& p = obr_.lookupObject<volScalarField>(pName_); + word fieldName = "p"; - return p.dimensions() == sqr(dimLength)/sqr(dimTime); + if (calcTotal_) + { + fieldName = "total(" + fieldName + ")"; + } + else + { + fieldName = "static(" + fieldName + ")"; + } + + if (calcCoeff_) + { + fieldName = fieldName + "_coeff"; + } + + return fieldName; +} + + +Foam::dimensionedScalar Foam::pressureTools::rho +( + const volScalarField& p +) const +{ + if (p.dimensions() == dimPressure) + { + return dimensionedScalar("1", dimless, 1.0); + } + else + { + return dimensionedScalar("rhoRef", dimDensity, rhoRef_); + } +} + + +Foam::dimensionedScalar Foam::pressureTools::pRef() const +{ + dimensionedScalar value("pRef", dimPressure, 0.0); + + if (calcTotal_) + { + value.value() += pRef_; + } + + return pRef(); +} + + +Foam::tmp<Foam::volScalarField> Foam::pressureTools::pDyn() const +{ + const fvMesh& mesh = refCast<const fvMesh>(obr_); + + tmp<volScalarField> tpDyn + ( + new volScalarField + ( + IOobject + ( + "pDyn", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", dimPressure, 0.0) + ) + ); + + if (calcTotal_) + { + const volVectorField& U = obr_.lookupObject<volVectorField>(UName_); + + tpDyn() == 0.5*magSqr(U); + } + + return tpDyn; +} + + +Foam::tmp<Foam::volScalarField> Foam::pressureTools::convertToCoeff +( + const volScalarField& p +) const +{ + tmp<volScalarField> tCoeff(p); + + if (calcCoeff_) + { + tCoeff() /= pDyn(); + } + + return tCoeff; } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::staticPressure::staticPressure +Foam::pressureTools::pressureTools ( const word& name, const objectRegistry& obr, @@ -55,8 +146,12 @@ Foam::staticPressure::staticPressure name_(name), obr_(obr), active_(true), - pName_(dict.lookupOrDefault<word>("p", "p")), - rho_(readScalar(dict.lookup("rho"))) + calcTotal_(false), + calcCoeff_(false), + pName_("p"), + UName_("U"), + pRef_(0.0), + rhoRef_(1.0) { // Check if the available mesh is an fvMesh, otherwise deactivate if (!isA<fvMesh>(obr_)) @@ -64,7 +159,7 @@ Foam::staticPressure::staticPressure active_ = false; WarningIn ( - "staticPressure::staticPressure" + "pressureTools::pressureTools" "(" "const word&, " "const objectRegistry&, " @@ -74,25 +169,6 @@ Foam::staticPressure::staticPressure ) << "No fvMesh available, deactivating." << nl << endl; } - else - { - // Check if the pressure is kinematic pressure, otherwise deactivate - if (!isKinematicPressure()) - { - active_ = false; - WarningIn - ( - "staticPressure::staticPressure" - "(" - "const word&, " - "const objectRegistry&, " - "const dictionary&, " - "const bool" - ")" - ) << "Pressure is not kinematic pressure, deactivating." << nl - << endl; - } - } read(dict); } @@ -100,53 +176,68 @@ Foam::staticPressure::staticPressure // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::staticPressure::~staticPressure() +Foam::pressureTools::~pressureTools() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::staticPressure::read(const dictionary& dict) +void Foam::pressureTools::read(const dictionary& dict) { if (active_) { - dict.readIfPresent("p", pName_); - dict.lookup("rho") >> rho_; + dict.readIfPresent("pName", pName_); + dict.readIfPresent("UName", UName_); + + const volScalarField& p = obr_.lookupObject<volScalarField>(pName_); + + if (p.dimensions() != p.dimensions()) + { + dict.lookup("rhoRef") >> rhoRef_; + } + + dict.lookup("calcTotal") >> calcTotal_; + if (calcTotal_) + { + dict.lookup("pRef") >> pRef_; + } + + dict.lookup("calcCoeff") >> calcCoeff_; } } -void Foam::staticPressure::execute() +void Foam::pressureTools::execute() { // Do nothing - only valid on write } -void Foam::staticPressure::end() +void Foam::pressureTools::end() { // Do nothing - only valid on write } -void Foam::staticPressure::write() +void Foam::pressureTools::write() { if (active_) { const volScalarField& p = obr_.lookupObject<volScalarField>(pName_); - volScalarField pStatic + volScalarField pResult ( IOobject ( - "pStatic", + pName(), obr_.time().timeName(), obr_, IOobject::NO_READ ), - dimensionedScalar("rho", dimDensity, rho_)*p + convertToCoeff(rho(p)*(p + pDyn()) + pRef()) ); - pStatic.write(); + pResult.write(); } } diff --git a/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.H b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.H new file mode 100644 index 0000000000000000000000000000000000000000..702d4961995f24d7856c619b7804304bc18cfd6e --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureTools.H @@ -0,0 +1,194 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Class + Foam::pressureTools + +Description + This function object includes tools to manipulate the pressure into + different forms. These currently include: + + - static pressure + + p_s = rho*p_k + + - total pressure + + p_T = pRef + p_s + 0.5 rho |U|^2 + + - static pressure coefficient + + Cp_s = p_s / (0.5 rho |U|^2) + + - total pressure coefficient + + Cp_T = p_T / (0.5 rho |U|^2) + + The function object will operate on both kinematic (p_k) and static + pressure (p_s) fields, and the result is written as a volScalarField. + +SourceFiles + pressureTools.C + IOpressureTools.H + +\*---------------------------------------------------------------------------*/ + +#ifndef pressureTools_H +#define pressureTools_H + +#include "volFieldsFwd.H" +#include "pointFieldFwd.H" +#include "dimensionedScalar.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; + +/*---------------------------------------------------------------------------*\ + Class pressureTools Declaration +\*---------------------------------------------------------------------------*/ + +class pressureTools +{ + // Private data + + //- Name of this set of pressureTools objects + word name_; + + //- Reference to the database + const objectRegistry& obr_; + + //- On/off switch + bool active_; + + //- Flag to calculate total pressure + bool calcTotal_; + + //- Flag to calculate pressure coefficient + bool calcCoeff_; + + //- Name of pressure field, default is "p" + word pName_; + + //- Name of velocity field, default is "U" + word UName_; + + //- Reference pressure level (used for total pressure) + scalar pRef_; + + //- Reference density value + scalar rhoRef_; + + + // Private Member Functions + + //- Return the name of the derived pressure field + word pName() const; + + //- Return the density scaling if supplied with kinematic pressure + dimensionedScalar rho(const volScalarField& p) const; + + //- Return the reference pressure + dimensionedScalar pRef() const; + + //- Calculate and return the (kinematic) dynamic pressure + tmp<volScalarField> pDyn() const; + + //- Convert to coeff data by applying the pDyn scaling + tmp<volScalarField> convertToCoeff(const volScalarField& p) const; + + //- Disallow default bitwise copy construct + pressureTools(const pressureTools&); + + //- Disallow default bitwise assignment + void operator=(const pressureTools&); + + +public: + + //- Runtime type information + TypeName("pressureTools"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + pressureTools + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~pressureTools(); + + + // Member Functions + + //- Return name of the set of pressureTools + virtual const word& name() const + { + return name_; + } + + //- Read the pressureTools 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(); + + //- Calculate the pressureTools and write + 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/utilities/pressureTools/pressureToolsFunctionObject.C b/src/postProcessing/functionObjects/utilities/pressureTools/pressureToolsFunctionObject.C new file mode 100644 index 0000000000000000000000000000000000000000..a512c193c8119a963e1095547007ed70a869a23c --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureToolsFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "pressureToolsFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(pressureToolsFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + pressureToolsFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.H b/src/postProcessing/functionObjects/utilities/pressureTools/pressureToolsFunctionObject.H similarity index 78% rename from src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.H rename to src/postProcessing/functionObjects/utilities/pressureTools/pressureToolsFunctionObject.H index 1b4d20e3f0b265f810a68153d943d43bf095bbb4..0b83c7d148ddb5a02c7b0d92690b274d504b933b 100644 --- a/src/postProcessing/functionObjects/utilities/staticPressure/staticPressureFunctionObject.H +++ b/src/postProcessing/functionObjects/utilities/pressureTools/pressureToolsFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,29 +22,29 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Typedef - Foam::staticPressureFunctionObject + Foam::pressureToolsFunctionObject Description - FunctionObject wrapper around staticPressure to allow it to be created via + FunctionObject wrapper around pressureTools to allow it to be created via the functions entry within controlDict. SourceFiles - staticPressureFunctionObject.C + pressureToolsFunctionObject.C \*---------------------------------------------------------------------------*/ -#ifndef staticPressureFunctionObject_H -#define staticPressureFunctionObject_H +#ifndef pressureToolsFunctionObject_H +#define pressureToolsFunctionObject_H -#include "staticPressure.H" +#include "pressureTools.H" #include "OutputFilterFunctionObject.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef OutputFilterFunctionObject<staticPressure> - staticPressureFunctionObject; + typedef OutputFilterFunctionObject<pressureTools> + pressureToolsFunctionObject; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/IOscalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/IOscalarTransport.H new file mode 100644 index 0000000000000000000000000000000000000000..37d3ef0f3d61b31b74e254ba84838a06c007bdd6 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/IOscalarTransport.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::IOscalarTransport + +Description + Instance of the generic IOOutputFilter for scalarTransport. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOscalarTransport_H +#define IOscalarTransport_H + +#include "scalarTransport.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter<scalarTransport> IOscalarTransport; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C new file mode 100644 index 0000000000000000000000000000000000000000..00518f6bdc033c86fa9137a7fb87288d6ab506da --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.C @@ -0,0 +1,271 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "scalarTransport.H" +#include "surfaceFields.H" +#include "dictionary.H" +#include "fixedValueFvPatchFields.H" +#include "zeroGradientFvPatchFields.H" +#include "fvScalarMatrix.H" +#include "fvmDdt.H" +#include "fvmDiv.H" +#include "fvcDiv.H" +#include "fvmLaplacian.H" +#include "fvmSup.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::scalarTransport, 0); + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::wordList Foam::scalarTransport::boundaryTypes() const +{ + const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_); + + wordList bTypes(U.boundaryField().size()); + + forAll(bTypes, patchI) + { + const fvPatchField<vector>& pf = U.boundaryField()[patchI]; + if (isA<fixedValueFvPatchVectorField>(pf)) + { + bTypes[patchI] = fixedValueFvPatchScalarField::typeName; + } + else + { + bTypes[patchI] = zeroGradientFvPatchScalarField::typeName; + } + } + + return bTypes; +} + + +Foam::tmp<Foam::volScalarField> Foam::scalarTransport::DT +( + const surfaceScalarField& phi +) const +{ + typedef incompressible::turbulenceModel icoModel; + typedef compressible::turbulenceModel cmpModel; + + if (userDT_) + { + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "DT", + mesh_.time().timeName(), + mesh_.time(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("DT", phi.dimensions()/dimLength, DT_) + ) + ); + } + else if (mesh_.foundObject<icoModel>("turbulenceModel")) + { + const icoModel& model = mesh_.lookupObject<icoModel>("turbulenceModel"); + + return model.nuEff(); + } + else if (mesh_.foundObject<cmpModel>("turbulenceModel")) + { + const cmpModel& model = mesh_.lookupObject<cmpModel>("turbulenceModel"); + + return model.muEff(); + } + else + { + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "DT", + mesh_.time().timeName(), + mesh_.time(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("DT", phi.dimensions()/dimLength, 0.0) + ) + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::scalarTransport::scalarTransport +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + mesh_(refCast<const fvMesh>(obr)), + active_(true), + phiName_("phi"), + UName_("U"), + DT_(0.0), + userDT_(false), + resetOnStartUp_(false), + nCorr_(0), + autoSchemes_(false), + sources_(mesh_), + T_ + ( + IOobject + ( + name, + mesh_.time().timeName(), + mesh_, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("zero", dimless, 0.0), + boundaryTypes() + ) +{ + read(dict); + + if (resetOnStartUp_) + { + T_ == dimensionedScalar("zero", dimless, 0.0); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::scalarTransport::~scalarTransport() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::scalarTransport::read(const dictionary& dict) +{ + if (active_) + { + Info<< type() << ":" << nl; + + phiName_ = dict.lookupOrDefault<word>("phiName", "phi"); + UName_ = dict.lookupOrDefault<word>("UName", "U"); + + userDT_ = false; + if (dict.readIfPresent("DT", DT_)) + { + userDT_ = true; + } + + dict.lookup("resetOnStartUp") >> resetOnStartUp_; + + dict.readIfPresent("nCorr", nCorr_); + + dict.lookup("autoSchemes") >> autoSchemes_; + + sources_.reset(dict.subDict("sources")); + } +} + + +void Foam::scalarTransport::execute() +{ + Info<< type() << " output:" << endl; + + const surfaceScalarField& phi = + mesh_.lookupObject<surfaceScalarField>(phiName_); + + // calculate the diffusivity + volScalarField DT(this->DT(phi)); + + // set schemes + word schemeVar = T_.name(); + if (autoSchemes_) + { + schemeVar = UName_; + } + + word divScheme("div(phi," + schemeVar + ")"); + word laplacianScheme("laplacian(" + DT.name() + "," + schemeVar + ")"); + + // set under-relaxation coeff + scalar relaxCoeff = 0.0; + if (mesh_.relaxEquation(schemeVar)) + { + relaxCoeff = mesh_.equationRelaxationFactor(schemeVar); + } + + // solve + for (label i = 0; i <= nCorr_; i++) + { + fvScalarMatrix TEqn + ( + fvm::ddt(T_) + + fvm::div(phi, T_, divScheme) + - fvm::laplacian(DT, T_, laplacianScheme) + == + sources_(T_) + ); + + TEqn.relax(relaxCoeff); + + sources_.constrain(TEqn); + + TEqn.solve(mesh_.solverDict(UName_)); + } + + Info<< endl; +} + + +void Foam::scalarTransport::end() +{ + // Do nothing +} + + +void Foam::scalarTransport::write() +{ + // Do nothing +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H new file mode 100644 index 0000000000000000000000000000000000000000..e08e40943a6de36f5a1686e87c1905020965267f --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransport.H @@ -0,0 +1,188 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Class + Foam::scalarTransport + +Description + This function object evolves a passive scalar transport equation. The + field in ininitially zero, to which sources are added. The field name + is assigned the name of the function object. Boundary conditions are + automatically applied, based on the velocity boundary conditions. + + - the field can be zeroed on start-up using the resetOnStartUp flag + - to employ the same numerical schemes as the flow velocity, use the + autoSchemes flag + - the diffusivity can be set manually using the DT entry, or retrieved + from the turbulence model (if applicable) + +SourceFiles + scalarTransport.C + IOscalarTransport.H + +SeeAlso + Foam::basicSourceList + +\*---------------------------------------------------------------------------*/ + +#ifndef scalarTransport_H +#define scalarTransport_H + +#include "volFields.H" +#include "surfaceFieldsFwd.H" +#include "pointFieldFwd.H" +#include "fvMatricesFwd.H" +#include "basicSourceList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; + +/*---------------------------------------------------------------------------*\ + Class scalarTransport Declaration +\*---------------------------------------------------------------------------*/ + +class scalarTransport +{ + // Private data + + //- Name of this set of scalarTransport objects + word name_; + + //- Reference to the mesh database + const fvMesh& mesh_; + + //- On/off switch + bool active_; + + //- Name of flux field (optional) + word phiName_; + + //- Name of velocity field (optional) + word UName_; + + //- Diffusion coefficient (optional) + scalar DT_; + + //- Flag to indicate whether user DT_ is used + bool userDT_; + + //- Flag to reset scalar field on start-up + bool resetOnStartUp_; + + //- Number of corrector iterations (optional) + label nCorr_; + + //- Flag to employ schemes for velocity for scalar transport + bool autoSchemes_; + + //- Run-time selectable sources + basicSourceList sources_; + + //- The scalar field + volScalarField T_; + + + // Private Member Functions + + //- Return the boundary types for the scalar field + wordList boundaryTypes() const; + + //- Return the diffusivity field + tmp<volScalarField> DT(const surfaceScalarField& phi) const; + + //- Disallow default bitwise copy construct + scalarTransport(const scalarTransport&); + + //- Disallow default bitwise assignment + void operator=(const scalarTransport&); + + +public: + + //- Runtime type information + TypeName("scalarTransport"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + scalarTransport + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~scalarTransport(); + + + // Member Functions + + //- Return name of the set of scalarTransport + virtual const word& name() const + { + return name_; + } + + //- Read the scalarTransport 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(); + + //- Calculate the scalarTransport and write + 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/utilities/scalarTransport/scalarTransportFunctionObject.C b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransportFunctionObject.C new file mode 100644 index 0000000000000000000000000000000000000000..3f9ba1b3ad410d031a6e811ec28a16e6c6328a35 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransportFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "scalarTransportFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(scalarTransportFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + scalarTransportFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransportFunctionObject.H b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransportFunctionObject.H new file mode 100644 index 0000000000000000000000000000000000000000..f5a417f4fdec04a7d24bf11989c1ba513ab478e7 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/scalarTransport/scalarTransportFunctionObject.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::scalarTransportFunctionObject + +Description + FunctionObject wrapper around scalarTransport to allow it to be + created via the functions entry within controlDict. + +SourceFiles + scalarTransportFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef scalarTransportFunctionObject_H +#define scalarTransportFunctionObject_H + +#include "scalarTransport.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject<scalarTransport> + scalarTransportFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/IOwallShearStress.H b/src/postProcessing/functionObjects/utilities/wallShearStress/IOwallShearStress.H new file mode 100644 index 0000000000000000000000000000000000000000..c7e453b1d8626d0154171d08119464efa973cef6 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/IOwallShearStress.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::IOwallShearStress + +Description + Instance of the generic IOOutputFilter for wallShearStress. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOwallShearStress_H +#define IOwallShearStress_H + +#include "wallShearStress.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter<wallShearStress> IOwallShearStress; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C new file mode 100644 index 0000000000000000000000000000000000000000..72244ea4b125c683a2d51b0733f3873ba309f372 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C @@ -0,0 +1,251 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "wallShearStress.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" +#include "compressible/turbulenceModel/turbulenceModel.H" +#include "wallPolyPatch.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineTypeNameAndDebug(Foam::wallShearStress, 0); + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::wallShearStress::makeFile() +{ + // Create the output file if not already created + if (outputFilePtr_.empty()) + { + if (debug) + { + Info<< "Creating output file." << endl; + } + + // File update + if (Pstream::master()) + { + fileName outputDir; + word startTimeName = + obr_.time().timeName(obr_.time().startTime().value()); + + if (Pstream::parRun()) + { + // Put in undecomposed case (Note: gives problems for + // distributed data running) + outputDir = + obr_.time().path()/".."/name_/startTimeName; + } + else + { + outputDir = obr_.time().path()/name_/startTimeName; + } + + // Create directory if does not exist + mkDir(outputDir); + + // Open new file at start up + outputFilePtr_.reset(new OFstream(outputDir/(type() + ".dat"))); + + // Add headers to output data + outputFilePtr_() << "# Wall shear stress" << nl + << "# time " << token::TAB << "patch" << token::TAB + << "min" << token::TAB << "max" << endl; + } + } +} + + +void Foam::wallShearStress::calcShearStress +( + const fvMesh& mesh, + const volSymmTensorField& Reff, + volVectorField& shearStress +) +{ + forAll(shearStress.boundaryField(), patchI) + { + const polyPatch& pp = mesh.boundaryMesh()[patchI]; + + if (isA<wallPolyPatch>(pp)) + { + vectorField& ssp = shearStress.boundaryField()[patchI]; + const vectorField& Sfp = mesh.Sf().boundaryField()[patchI]; + const scalarField& magSfp = mesh.magSf().boundaryField()[patchI]; + const symmTensorField& Reffp = Reff.boundaryField()[patchI]; + + ssp = (-Sfp/magSfp) & Reffp; + + vector minSsp = min(ssp); + vector maxSsp = max(ssp); + + outputFilePtr_() << mesh.time().timeName() << token::TAB + << pp.name() << token::TAB << minSsp + << token::TAB << maxSsp << endl; + + if (log_) + { + Info<< " min/max(" << pp.name() << ") = " + << minSsp << ", " << maxSsp << endl; + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallShearStress::wallShearStress +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + log_(false), + phiName_("phi"), + outputFilePtr_(NULL) +{ + // Check if the available mesh is an fvMesh, otherwise deactivate + if (!isA<fvMesh>(obr_)) + { + active_ = false; + WarningIn + ( + "wallShearStress::wallShearStress" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating." << nl + << endl; + } + + makeFile(); + + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallShearStress::~wallShearStress() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::wallShearStress::read(const dictionary& dict) +{ + if (active_) + { + log_ = dict.lookupOrDefault<Switch>("log", false); + phiName_ = dict.lookupOrDefault<word>("phiName", "phi"); + } +} + + +void Foam::wallShearStress::execute() +{ + // Do nothing - only valid on write +} + + +void Foam::wallShearStress::end() +{ + // Do nothing - only valid on write +} + + +void Foam::wallShearStress::write() +{ + typedef compressible::turbulenceModel cmpModel; + typedef incompressible::turbulenceModel icoModel; + + if (active_) + { + const fvMesh& mesh = refCast<const fvMesh>(obr_); + + volVectorField wallShearStress + ( + IOobject + ( + "wallShearStress", + mesh.time().timeName(), + mesh, + IOobject::NO_READ + ), + mesh, + dimensionedVector("0", sqr(dimLength)/sqr(dimTime), vector::zero) + ); + + if (log_) + { + Info<< type() << " output:" << nl; + } + + + const surfaceScalarField& phi = + obr_.lookupObject<surfaceScalarField>(phiName_); + + tmp<volSymmTensorField> Reff; + if (phi.dimensions() == dimMass/dimTime) + { + const cmpModel& model = + mesh.lookupObject<cmpModel>("turbulenceModel"); + + Reff = model.devRhoReff(); + } + else + { + const icoModel& model = + mesh.lookupObject<icoModel>("turbulenceModel"); + + Reff = model.devReff(); + } + + + calcShearStress(mesh, Reff(), wallShearStress); + + if (log_) + { + Info<< endl; + } + + wallShearStress.write(); + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H new file mode 100644 index 0000000000000000000000000000000000000000..b2cff373bece4fac9337ed316d21e2d11bf2cb15 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.H @@ -0,0 +1,163 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Class + Foam::wallShearStress + +Description + Evaluates and outputs wall shear stress. Values written to time folders + as field 'wallShearStress' + +SourceFiles + wallShearStress.C + IOwallShearStress.H + +\*---------------------------------------------------------------------------*/ + +#ifndef wallShearStress_H +#define wallShearStress_H + +#include "volFieldsFwd.H" +#include "pointFieldFwd.H" +#include "Switch.H" +#include "OFstream.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class mapPolyMesh; +class fvMesh; + +/*---------------------------------------------------------------------------*\ + Class wallShearStress Declaration +\*---------------------------------------------------------------------------*/ + +class wallShearStress +{ + // Private data + + //- Name of this set of wallShearStress object + word name_; + + const objectRegistry& obr_; + + //- on/off switch + bool active_; + + //- Switch to send output to Info as well as to file + Switch log_; + + //- Name of mass/volume flux field (optional, default = phi) + word phiName_; + + //- Output file pointer + autoPtr<OFstream> outputFilePtr_; + + + // Private Member Functions + + //- Make the output file + virtual void makeFile(); + + //- Calculate the shear stress + void calcShearStress + ( + const fvMesh& mesh, + const volSymmTensorField& Reff, + volVectorField& shearStress + ); + + //- Disallow default bitwise copy construct + wallShearStress(const wallShearStress&); + + //- Disallow default bitwise assignment + void operator=(const wallShearStress&); + + +public: + + //- Runtime type information + TypeName("wallShearStress"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + wallShearStress + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~wallShearStress(); + + + // Member Functions + + //- Return name of the set of wallShearStress + virtual const word& name() const + { + return name_; + } + + //- Read the wallShearStress 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(); + + //- Calculate the wallShearStress and write + 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/utilities/wallShearStress/wallShearStressFunctionObject.C b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStressFunctionObject.C new file mode 100644 index 0000000000000000000000000000000000000000..871e6b0373a84d9a3d6ccaf39a3561f97e3f6f60 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStressFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "wallShearStressFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(wallShearStressFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + wallShearStressFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStressFunctionObject.H b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStressFunctionObject.H new file mode 100644 index 0000000000000000000000000000000000000000..6b0dfc47f4894e04f98fed53a86af7c757290a0d --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStressFunctionObject.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ 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 <http://www.gnu.org/licenses/>. + +Typedef + Foam::wallShearStressFunctionObject + +Description + FunctionObject wrapper around wallShearStress to allow it to be created + via the functions entry within controlDict. + +SourceFiles + wallShearStressFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef wallShearStressFunctionObject_H +#define wallShearStressFunctionObject_H + +#include "wallShearStress.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject<wallShearStress> + wallShearStressFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/sampling/sampledSet/writers/writer.C b/src/sampling/sampledSet/writers/writer.C index ded4523d1c8ad5d62cceaf0b287da701340bcf67..69dbdec6fe7a14c5b7ec1c5834682b8f6396a316 100644 --- a/src/sampling/sampledSet/writers/writer.C +++ b/src/sampling/sampledSet/writers/writer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -152,6 +152,25 @@ Foam::writer<Type>::~writer() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class Type> +void Foam::writer<Type>::write +( + const coordSet& points, + const wordList& valueSetNames, + const List<Field<Type> >& valueSets, + Ostream& os +) const +{ + List<const Field<Type>*> valueSetPtrs(valueSets.size()); + forAll(valueSetPtrs, i) + { + valueSetPtrs[i] = &valueSets[i]; + } + + write(points, valueSetNames, valueSetPtrs, os); +} + + template<class Type> Foam::Ostream& Foam::writer<Type>::write ( diff --git a/src/sampling/sampledSet/writers/writer.H b/src/sampling/sampledSet/writers/writer.H index 6e55a20b6ed2592f88344d1f6219240685547196..8c754bd47b13444b07874c0ad1f71e499f921925 100644 --- a/src/sampling/sampledSet/writers/writer.H +++ b/src/sampling/sampledSet/writers/writer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,13 +40,7 @@ Description // Output list of points and corresponding values scalarFormatter().write ( - coordSet - ( - points, // sample coordinates - "someLine", // name of coordSet - "distance", // write coordinates as distance to refPoint - points[0] // reference point - ), + coordSet(...) "U.component(0)", // name of values vals // values ); @@ -164,6 +158,17 @@ public: Ostream& ) const = 0; + //- General entry point for writing. + // The data is organized in a set of point with one or more values + // per point + virtual void write + ( + const coordSet&, + const wordList&, + const List<Field<Type> >&, + Ostream& + ) const; + //- General entry point for writing of multiple coordSets. // Each coordSet (track) has same data variables. // The data is per variable, per track, per point of track. diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs b/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs index 8e8704743c969fa5c9d7423cb34807777b49e09b..e02d1a8b67c9d103eb069cd76d4885a5652ae6ec 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs +++ b/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs @@ -12,6 +12,7 @@ forces functionObjectLibs ( "libforces.so" ); outputControl timeStep; outputInterval 1; + log yes; patches ( "motorBike.*" ); pName p; @@ -26,6 +27,10 @@ forces magUInf 20; lRef 1.42; // Wheelbase length Aref 0.75; // Estimated + + nBin 20; // output data into bins + binDir (1 0 0); // bin direction + binFormat gnuplot; } diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSolution b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSolution index e8dfb0d5891d36239e3783b295327afa0c8e94e0..f1e4568f0e9065603ca25c3ebf19399671c5d9e0 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSolution +++ b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/system/fvSolution @@ -92,10 +92,5 @@ PIMPLE alphaTemp 0.005; } -additional -{ - solveSpecies true; -} - // ************************************************************************* // diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSolution b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSolution index 767258ad471d00ea4f291c01fcbaabeed5ca3c01..b9b9e87728cdf102eb7cb5d96ec0b2962f70cd3b 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSolution +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/system/fvSolution @@ -76,10 +76,5 @@ PIMPLE maxDeltaT 1; } -additional -{ - solveSpecies true; -} - // ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/G b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/G deleted file mode 100644 index efb1f9315b26497b930b00d387c23592da3228d3..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/G +++ /dev/null @@ -1,38 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object G; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 0 -3 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - walls - { - type MarshakRadiation; - T T; - emissivityMode lookup; - emissivity uniform 1.0; - value uniform 0; - } - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/H2O b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/H2O deleted file mode 100644 index 2a4d595a980264ca7980a6969ef96b8e7b6cdaa7..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/H2O +++ /dev/null @@ -1,36 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object H2O; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.0; - -boundaryField -{ - walls - { - type zeroGradient; - } - frontAndBack - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/N2 b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/N2 deleted file mode 100644 index f0bc31304f0a812450c48dd9776937fff45b3472..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/N2 +++ /dev/null @@ -1,36 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object N2; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.79; - -boundaryField -{ - walls - { - type zeroGradient; - } - frontAndBack - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/O2 b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/O2 deleted file mode 100644 index d5250c143252e530b454f4566172532097ddb92b..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/O2 +++ /dev/null @@ -1,36 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object O2; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 0 0 0 0]; - -internalField uniform 0.21; - -boundaryField -{ - walls - { - type zeroGradient; - } - frontAndBack - { - type empty; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/T b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/T deleted file mode 100644 index f802e931396ae99dbf1476664e0758ae46592e8d..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/T +++ /dev/null @@ -1,35 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - location "0"; - class volScalarField; - object T; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 0 0 1 0 0 0]; - -internalField uniform 400; - -boundaryField -{ - walls - { - type fixedValue; - value uniform 400; - } - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/U b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/U deleted file mode 100644 index 94f2d344f9f689f69f1993b8e2bb623a256b376d..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/U +++ /dev/null @@ -1,35 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - location "0"; - class volVectorField; - object U; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -1 0 0 0 0]; - -internalField uniform (0 0 0); - -boundaryField -{ - walls - { - type fixedValue; - value uniform (0 0 0); - } - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/p b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/p deleted file mode 100644 index 2d5a62b831686b826a2fcb63f1f67998309672a5..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/0/p +++ /dev/null @@ -1,34 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class volScalarField; - location "0"; - object p; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [1 -1 -2 0 0 0 0]; - -internalField uniform 100000; - -boundaryField -{ - walls - { - type zeroGradient; - } - frontAndBack - { - type empty; - } -} - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties deleted file mode 100644 index 9272b39a42f4d90ff615c0ea75c938c889278c3c..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/chemistryProperties +++ /dev/null @@ -1,45 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object chemistryProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -rhoChemistryModel ODEChemistryModel<gasThermoPhysics>; - -chemistry off; - -chemistrySolver ode; - -initialChemicalTimeStep 1e-07; - -sequentialCoeffs -{ - cTauChem 0.001; -} - -EulerImplicitCoeffs -{ - cTauChem 0.05; - equilibriumRateLimiter off; -} - -odeCoeffs -{ - solver RK; - eps 0.05; - scale 1; -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/combustionProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/combustionProperties deleted file mode 100644 index 334391590cc303976e6e72e1e1c8ca7d474ada5a..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/combustionProperties +++ /dev/null @@ -1,29 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object combustionProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -combustionModel PaSR<rhoChemistryCombustion>; - -active false; - -PaSRCoeffs -{ - Cmix 1.0; - turbulentReaction off; -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/foam.dat b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/foam.dat deleted file mode 100644 index 1cff004fd842eec1c81167ac061ec05015f4d453..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/foam.dat +++ /dev/null @@ -1,85 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object foam.dat; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -O2 -{ - specie - { - nMoles 1; - molWeight 31.9988; - } - thermodynamics - { - Tlow 200; - Thigh 5000; - Tcommon 1000; - highCpCoeffs ( 3.69758 0.00061352 -1.25884e-07 1.77528e-11 -1.13644e-15 -1233.93 3.18917 ); - lowCpCoeffs ( 3.21294 0.00112749 -5.75615e-07 1.31388e-09 -8.76855e-13 -1005.25 6.03474 ); - } - transport - { - As 1.67212e-06; - Ts 170.672; - } -} - -H2O -{ - specie - { - nMoles 1; - molWeight 18.0153; - } - thermodynamics - { - Tlow 200; - Thigh 5000; - Tcommon 1000; - highCpCoeffs ( 2.67215 0.00305629 -8.73026e-07 1.201e-10 -6.39162e-15 -29899.2 6.86282 ); - lowCpCoeffs ( 3.38684 0.00347498 -6.3547e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 ); - } - transport - { - As 1.67212e-06; - Ts 170.672; - } -} - -N2 -{ - specie - { - nMoles 1; - molWeight 28.0134; - } - thermodynamics - { - Tlow 200; - Thigh 5000; - Tcommon 1000; - highCpCoeffs ( 2.92664 0.00148798 -5.68476e-07 1.0097e-10 -6.75335e-15 -922.798 5.98053 ); - lowCpCoeffs ( 3.29868 0.00140824 -3.96322e-06 5.64152e-09 -2.44486e-12 -1020.9 3.95037 ); - } - transport - { - As 1.67212e-06; - Ts 170.672; - } -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/foam.inp b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/foam.inp deleted file mode 100644 index 84c3df95ee991c31b4e09c14ebfd8f63213dc092..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/foam.inp +++ /dev/null @@ -1,10 +0,0 @@ -species -( - O2 - H2O - N2 -); - -reactions -{} - diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/g b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/g deleted file mode 100644 index 057403310a4dba8dc69f1470dd26d8a7d6d6b978..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/g +++ /dev/null @@ -1,22 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class uniformDimensionedVectorField; - location "constant"; - object g; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 -2 0 0 0 0]; -value ( 0 0 0 ); - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/blockMeshDict b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/blockMeshDict deleted file mode 100644 index 6a0b785dba0e1ba11c89f345bb03ac33fcca95c2..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/blockMeshDict +++ /dev/null @@ -1,69 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant/polyMesh"; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -convertToMeters 0.001; - -vertices -( - ( 0 0 0) - (12 0 0) - (12 12 0) - ( 0 12 0) - ( 0 0 1) - (12 0 1) - (12 12 1) - ( 0 12 1) -); - -blocks -( - hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) -); - -edges -( -); - -boundary -( - walls - { - type wall; - faces - ( - (3 7 6 2) - (0 4 7 3) - (2 6 5 1) - (1 5 4 0) - ); - } - frontAndBack - { - type empty; - faces - ( - (0 3 2 1) - (4 5 6 7) - ); - } -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/boundary b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/boundary deleted file mode 100644 index 4cedcfa0c04435069144017a4772820d84651736..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/polyMesh/boundary +++ /dev/null @@ -1,35 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -2 -( - walls - { - type wall; - nFaces 80; - startFace 760; - } - frontAndBack - { - type empty; - inGroups 1(empty); - nFaces 800; - startFace 840; - } -) - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties deleted file mode 100644 index 92d917896f71964335ecaa6586eb403353e2ec13..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/radiationProperties +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object radiationProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -radiation off; - -radiationModel none; - -solverFreq 10; - -P1Coeffs -{ - C C [ 0 0 0 0 0 0 0 ] 0; -} - -absorptionEmissionModel binaryAbsorptionEmission; - -binaryAbsorptionEmissionCoeffs -{ - model1 - { - absorptionEmissionModel constantAbsorptionEmission; - constantAbsorptionEmissionCoeffs - { - a a [ 0 -1 0 0 0 0 0 ] 0.5; - e e [ 0 -1 0 0 0 0 0 ] 0.5; - E E [ 1 -1 -3 0 0 0 0 ] 0; - } - } - model2 - { - absorptionEmissionModel cloudAbsorptionEmission; - cloudAbsorptionEmissionCoeffs - { - cloudNames - ( - reactingCloud1 - ); - } - } -} - -scatterModel cloudScatter; - -cloudScatterCoeffs -{ - cloudNames - ( - reactingCloud1 - ); -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Positions b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Positions deleted file mode 100644 index 182663b4d2fd9ce28b5afc5518ecfd393002765b..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Positions +++ /dev/null @@ -1,44 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class vectorField; - location "constant"; - object reactingCloud1Positions; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -( -(0.002 0.002 0.00005) -(0.004 0.002 0.00005) -(0.006 0.002 0.00005) -(0.008 0.002 0.00005) -(0.010 0.002 0.00005) -(0.002 0.004 0.00005) -(0.004 0.004 0.00005) -(0.006 0.004 0.00005) -(0.008 0.004 0.00005) -(0.010 0.004 0.00005) -(0.002 0.006 0.00005) -(0.004 0.006 0.00005) -(0.006 0.006 0.00005) -(0.008 0.006 0.00005) -(0.010 0.006 0.00005) -(0.002 0.008 0.00005) -(0.004 0.008 0.00005) -(0.006 0.008 0.00005) -(0.008 0.008 0.00005) -(0.010 0.008 0.00005) -(0.002 0.010 0.00005) -(0.004 0.010 0.00005) -(0.006 0.010 0.00005) -(0.008 0.010 0.00005) -(0.010 0.010 0.00005) -) -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties deleted file mode 100644 index 66f9133ca1b60da162fff6a054af71b89fecaa31..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties +++ /dev/null @@ -1,167 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object reactingCloud1Properties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solution -{ - active true; - coupled true; - transient yes; - cellValueSourceCorrection on; - - sourceTerms - { - schemes - { - rho explicit 1; - U explicit 1; - Yi explicit 1; - h explicit 1; - radiation explicit 1; - } - } - - interpolationSchemes - { - rho cell; - U cellPoint; - mu cell; - T cell; - Cp cell; - p cell; - } - - integrationSchemes - { - U Euler; - T analytical; - } -} - - -constantProperties -{ - rho0 1000; - T0 300; - Cp0 4187; - - youngsModulus 1e9; - poissonsRatio 0.35; - - epsilon0 1; - f0 0.5; - Pr 0.7; - Tvap 273; - Tbp 373; - LDevol 0; - hRetentionCoeff 1; - - constantVolume false; -} - - -subModels -{ - particleForces - { - sphereDrag; - gravity; - } - - injectionModels - { - model1 - { - type manualInjection; - massTotal 1e-8; - parcelBasisType mass; - SOI 0; - positionsFile "reactingCloud1Positions"; - U0 ( 0 0 0 ); - sizeDistribution - { - type uniform; - uniformDistribution - { - minValue 1e-04; - maxValue 1e-04; - } - } - } - } - - dispersionModel none; - - patchInteractionModel standardWallInteraction; - - heatTransferModel RanzMarshall; - - compositionModel singleMixtureFraction; - - phaseChangeModel liquidEvaporation; - - devolatilisationModel none; - - surfaceReactionModel none; - - surfaceFilmModel none; - - radiation off; - - standardWallInteractionCoeffs - { - type rebound; - } - - RanzMarshallCoeffs - { - BirdCorrection true; - } - - singleMixtureFractionCoeffs - { - phases - ( - gas - { - } - liquid - { - H2O 1; - } - solid - { - } - ); - YGasTot0 0; - YLiquidTot0 1; - YSolidTot0 0; - } - - liquidEvaporationCoeffs - { - enthalpyTransfer enthalpyDifference; - - activeLiquids ( H2O ); - } -} - - -cloudFunctions -{} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties deleted file mode 100644 index 19fe38234acf474b6773c73d6567fbdc4bd39b8e..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/thermophysicalProperties +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object thermophysicalProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -thermoType heRhoReactionThermo<reactingMixture<gasThermoPhysics>>; - -chemistryReader foamChemistryReader; - -foamChemistryFile "$FOAM_CASE/constant/foam.inp"; - -foamChemistryThermoFile "$FOAM_CASE/constant/foam.dat"; - -inertSpecie N2; - -liquids -{ - H2O - { - defaultCoeffs yes; - } -} - -solids -{ - // none -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/turbulenceProperties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/turbulenceProperties deleted file mode 100644 index c2c3b28a1b4e8f4a2cae55f58bd61f9b1a67b488..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/turbulenceProperties +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object turbulenceProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -simulationType laminar; - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/controlDict b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/controlDict deleted file mode 100644 index 1e05026d5b90c5e1da6fd49a9455255a9b878e8d..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/controlDict +++ /dev/null @@ -1,55 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object controlDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application reactingParcelFoam; - -startFrom startTime; - -startTime 0; - -stopAt endTime; - -endTime 0.5; - -deltaT 1e-03; - -writeControl adjustableRunTime; - -writeInterval 0.05; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 10; - -writeCompression off; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable true; - -adjustTimeStep yes; - -maxCo 0.3; - -maxDeltaT 1e-03; - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/decomposeParDict b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/decomposeParDict deleted file mode 100644 index 645728dc500f665c9e1e372fdf2124b85c2ffcaa..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/decomposeParDict +++ /dev/null @@ -1,45 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object decomposeParDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -numberOfSubdomains 4; - -method scotch; - -simpleCoeffs -{ - n ( 2 2 1 ); - delta 0.001; -} - -hierarchicalCoeffs -{ - n ( 1 1 1 ); - delta 0.001; - order xyz; -} - -manualCoeffs -{ - dataFile ""; -} - -distributed no; - -roots ( ); - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes deleted file mode 100644 index 5bdcead59e92afdeb29887c85e74fe92005dff31..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSchemes +++ /dev/null @@ -1,70 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object fvSchemes; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -ddtSchemes -{ - default Euler; -} - -gradSchemes -{ - default Gauss linear; - grad(p) Gauss linear; -} - -divSchemes -{ - default none; - div(phi,U) Gauss upwind; - div(phid,p) Gauss upwind; - div(phi,K) Gauss linear; - div(phi,k) Gauss upwind; - div(phi,epsilon) Gauss upwind; - div(U) Gauss linear; - div((muEff*dev2(T(grad(U))))) Gauss linear; - div(phi,Yi_h) Gauss upwind; -} - -laplacianSchemes -{ - default Gauss linear corrected; - laplacian(muEff,U) Gauss linear corrected; - laplacian(mut,U) Gauss linear corrected; - laplacian(DkEff,k) Gauss linear corrected; - laplacian(DepsilonEff,epsilon) Gauss linear corrected; - laplacian(DREff,R) Gauss linear corrected; - laplacian((rho*(1|A(U))),p) Gauss linear corrected; -} - -interpolationSchemes -{ - default linear; -} - -snGradSchemes -{ - default corrected; -} - -fluxRequired -{ - default no; - p ; -} - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSolution b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSolution deleted file mode 100644 index b0128ed1211a3b93a8988f34a498678a52fb0b6e..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/system/fvSolution +++ /dev/null @@ -1,101 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object fvSolution; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solvers -{ - rho - { - solver PCG; - preconditioner DIC; - tolerance 1e-05; - relTol 0.1; - } - - rhoFinal - { - $rho; - tolerance 1e-05; - relTol 0; - } - - "(U|h)" - { - solver PBiCG; - preconditioner DILU; - tolerance 1e-05; - relTol 0.1; - } - - p - { - solver PCG; - preconditioner DIC; - tolerance 1e-06; - relTol 0.1; - } - - pFinal - { - $p; - tolerance 1e-06; - relTol 0; - } - - "(U|h)Final" - { - $U; - tolerance 1e-05; - relTol 0; - } - - "(k|epsilon)" - { - $UFinal; - } - - "(Yi|O2|N2|H2O)" - { - $UFinal; - } -} - -PIMPLE -{ - transonic no; - nOuterCorrectors 1; - nCorrectors 2; - nNonOrthogonalCorrectors 0; - momentumPredictor yes; -} - -additional -{ - solveSpecies true; -} - -relaxationFactors -{ - fields - { - } - equations - { - ".*Final" 1; - } -} - -// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/system/fvSolution b/tutorials/lagrangian/reactingParcelFoam/filter/system/fvSolution index 88c7b8de2381925bb4b4e1d552b49bf8d359b72d..7af9d07faef87dd7ff43cfd3fc951fd5d4f54ce5 100644 --- a/tutorials/lagrangian/reactingParcelFoam/filter/system/fvSolution +++ b/tutorials/lagrangian/reactingParcelFoam/filter/system/fvSolution @@ -83,10 +83,6 @@ PIMPLE momentumPredictor yes; } -additional -{ -} - relaxationFactors { fields diff --git a/tutorials/lagrangian/reactingParcelFoam/parcelInBox/system/fvSolution b/tutorials/lagrangian/reactingParcelFoam/parcelInBox/system/fvSolution index 05fc17fe639f540441934a240cb3f4d52b65dbd7..50950087e3923aec61644995a773e50543eb3fb6 100644 --- a/tutorials/lagrangian/reactingParcelFoam/parcelInBox/system/fvSolution +++ b/tutorials/lagrangian/reactingParcelFoam/parcelInBox/system/fvSolution @@ -82,10 +82,6 @@ PIMPLE momentumPredictor yes; } -additional -{ -} - relaxationFactors { fields diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/fvSolution b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/fvSolution index fb6fda233165b492ed40de05f759279c000e3399..f52df1d2f81d5cc1d90e40a9079baec3edad1c86 100644 --- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/fvSolution +++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/fvSolution @@ -88,10 +88,6 @@ potentialFlow nNonOrthogonalCorrectors 5; } -additional -{ -} - relaxationFactors { fields