From 2005f3ab0a794b645787bf5be2d5d34a17662766 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 18 Feb 2011 17:52:34 +0000 Subject: [PATCH 1/3] BUG: Corrected chemistry reactions - read from dictionary --- .../reaction/Reactions/Reaction/Reaction.C | 21 +++++++++++++++++-- .../reaction/Reactions/Reaction/Reaction.H | 17 ++++++++++++++- .../reaction/Reactions/Reaction/ReactionI.H | 16 +++++++++++++- .../Reactions/ReactionList/ReactionList.C | 9 +++++--- .../ras/counterFlowFlame2D/constant/reactions | 3 ++- .../simplifiedSiwek/constant/foam.inp | 6 ++++-- .../counterFlowFlame2D/constant/reactions | 5 +++-- 7 files changed, 65 insertions(+), 12 deletions(-) diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C index 1c8326e61c..a9cc3650b5 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,8 +26,21 @@ License #include "Reaction.H" #include "DynamicList.H" +// * * * * * * * * * * * * * * * * Static Data * * * * * * * * * * * * * * * // + +template +Foam::label Foam::Reaction::nUnNamedReactions = 0; + + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +template +Foam::label Foam::Reaction::getNewReactionID() +{ + return nUnNamedReactions++; +} + + template Foam::string Foam::Reaction::reactionStr() const { @@ -114,6 +127,7 @@ Foam::Reaction::Reaction ) : ReactionThermo(*thermoDatabase[species[0]]), + name_("un-named-reaction-" + Foam::name(getNewReactionID())), species_(species), lhs_(lhs), rhs_(rhs) @@ -130,6 +144,7 @@ Foam::Reaction::Reaction ) : ReactionThermo(r), + name_(r.name() + "Copy"), species_(species), lhs_(r.lhs_), rhs_(r.rhs_) @@ -236,6 +251,7 @@ Foam::Reaction::Reaction ) : ReactionThermo(*thermoDatabase[species[0]]), + name_("un-named-reaction" + Foam::name(getNewReactionID())), species_(species) { setLRhs(is); @@ -252,6 +268,7 @@ Foam::Reaction::Reaction ) : ReactionThermo(*thermoDatabase[species[0]]), + name_(dict.dictName()), species_(species) { setLRhs(IStringStream(dict.lookup("reaction"))()); @@ -318,7 +335,7 @@ Foam::Reaction::New const dictionary& dict ) { - const word& reactionTypeName = dict.dictName(); + const word& reactionTypeName = dict.lookup("type"); typename dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(reactionTypeName); diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H index cc6e0efac3..da39eebbfe 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,6 +69,12 @@ class Reaction public: + // Static data + + //- Number of un-named reactions + static label nUnNamedReactions; + + // Public data types //- Class to hold the specie index and its coefficients in the @@ -112,6 +118,9 @@ private: // Private data + //- Name of reaction + const word name_; + //- List of specie names present in reaction system const speciesTable& species_; @@ -136,6 +145,9 @@ private: //- Disallow default bitwise assignment void operator=(const Reaction&); + //- Return new reaction ID for un-named reactions + label getNewReactionID(); + public: @@ -282,6 +294,9 @@ public: // Access + inline word& name(); + inline const word& name() const; + inline const List& lhs() const; inline const List& rhs() const; diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H index c209910b1e..b981311ddd 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H +++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/ReactionI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,6 +32,20 @@ namespace Foam // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +inline word& Reaction::name() +{ + return name(); +} + + +template +inline const word& Reaction::name() const +{ + return name(); +} + + template inline const List::specieCoeffs>& Reaction::lhs() const diff --git a/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.C b/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.C index 52b2984114..1758c21370 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/ReactionList/ReactionList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,13 +105,15 @@ bool Foam::ReactionList::readReactionDict() forAllConstIter(dictionary, reactions, iter) { + const word reactionName = iter().keyword(); + this->append ( Reaction::New ( species_, thermoDb_, - reactions.subDict(iter().keyword()) + reactions.subDict(reactionName) ).ptr() ); } @@ -129,8 +131,9 @@ void Foam::ReactionList::write(Ostream& os) const forAllConstIter(typename SLPtrList >, *this, iter) { const Reaction& r = iter(); - os << indent << r.type() << nl + os << indent << r.name() << nl << indent << token::BEGIN_BLOCK << incrIndent << nl; + os.writeKeyword("type") << r.type() << nl; r.write(os); os << decrIndent << indent << token::END_BLOCK << nl; } diff --git a/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/reactions b/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/reactions index 5f5ae52ee2..839b5e4e45 100644 --- a/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/reactions +++ b/tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/constant/reactions @@ -9,8 +9,9 @@ species reactions { - irreversibleArrheniusReaction + methaneReaction { + type irreversibleArrheniusReaction; reaction "CH4 + 2O2 = CO2 + 2H2O"; A 5.2e16; beta 0; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/foam.inp b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/foam.inp index 931071dabe..3bf043478b 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/foam.inp +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/foam.inp @@ -10,15 +10,17 @@ species reactions { - irreversibleArrheniusReaction + methaneReaction { + type irreversibleArrheniusReaction; reaction "CH4 + 2O2^1.0 = CO2 + 2H2O^1.0"; A 7e+06; beta 0; Ta 10063.8; } - irreversibleArrheniusReaction + hydrogenReaction { + type irreversibleArrheniusReaction; reaction "H2 + 0.5O2^1.0 = H2O"; A 4.74342e+12; beta 0; diff --git a/tutorials/lagrangian/steadyReactingParcelFoam/counterFlowFlame2D/constant/reactions b/tutorials/lagrangian/steadyReactingParcelFoam/counterFlowFlame2D/constant/reactions index f2aa545726..e548bae90f 100644 --- a/tutorials/lagrangian/steadyReactingParcelFoam/counterFlowFlame2D/constant/reactions +++ b/tutorials/lagrangian/steadyReactingParcelFoam/counterFlowFlame2D/constant/reactions @@ -9,11 +9,12 @@ species reactions { - irreversibleArrheniusReaction + methaneReaction { + type irreversibleArrheniusReaction; reaction "CH4 + 2O2 = CO2 + 2H2O"; A 5.2e16; beta 0; Ta 14906; } -} \ No newline at end of file +} From 8b1950a10a165cf0779d9ca8233db77f78c3d6c0 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 19 Feb 2011 16:50:48 +0000 Subject: [PATCH 2/3] DimensionedTensorField: Corrected dimensions of eigenvalues and eigenvectors --- .../DimensionedTensorField/DimensionedTensorField.C | 10 +++++----- .../DimensionedTensorField/DimensionedTensorField.H | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.C index 3583349427..1b90ac0555 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,11 +46,11 @@ UNARY_FUNCTION(tensor, tensor, dev2, transform) UNARY_FUNCTION(scalar, tensor, det, transform) UNARY_FUNCTION(tensor, tensor, cof, cof) UNARY_FUNCTION(tensor, tensor, inv, inv) -UNARY_FUNCTION(vector, tensor, eigenValues, sign) -UNARY_FUNCTION(tensor, tensor, eigenVectors, transform) +UNARY_FUNCTION(vector, tensor, eigenValues, transform) +UNARY_FUNCTION(tensor, tensor, eigenVectors, sign) -UNARY_FUNCTION(vector, symmTensor, eigenValues, sign) -UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, transform) +UNARY_FUNCTION(vector, symmTensor, eigenValues, transform) +UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, sign) // * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.H b/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.H index 50e7c1a430..0c7a599060 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.H +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedTensorField/DimensionedTensorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,11 +59,11 @@ UNARY_FUNCTION(tensor, tensor, dev2, transform) UNARY_FUNCTION(scalar, tensor, det, transform) UNARY_FUNCTION(tensor, tensor, cof, cof) UNARY_FUNCTION(tensor, tensor, inv, inv) -UNARY_FUNCTION(vector, tensor, eigenValues, sign) -UNARY_FUNCTION(tensor, tensor, eigenVectors, transform) +UNARY_FUNCTION(vector, tensor, eigenValues, transform) +UNARY_FUNCTION(tensor, tensor, eigenVectors, sign) -UNARY_FUNCTION(vector, symmTensor, eigenValues, sign) -UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, transform) +UNARY_FUNCTION(vector, symmTensor, eigenValues, transform) +UNARY_FUNCTION(symmTensor, symmTensor, eigenVectors, sign) // * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * // From 6cf70a7d524a47dcbd3728f111c3545bb8e9bc60 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 19 Feb 2011 18:16:59 +0000 Subject: [PATCH 3/3] Removed all components relating to the unsupported error estimation code --- .../estimateScalarError/Make/files | 3 - .../estimateScalarError/Make/options | 9 - .../estimateScalarError/estimateScalarError.C | 133 ------------- .../icoErrorEstimate/Make/files | 4 - .../icoErrorEstimate/Make/options | 9 - .../icoErrorEstimate/icoErrorEstimate.C | 129 ------------ .../errorEstimation/icoMomentError/Make/files | 4 - .../icoMomentError/Make/options | 9 - .../icoMomentError/icoMomentError.C | 188 ------------------ .../momentScalarError/Make/files | 3 - .../momentScalarError/Make/options | 8 - .../momentScalarError/momentScalarError.C | 185 ----------------- .../foamDebugSwitches/Make/options | 1 - 13 files changed, 685 deletions(-) delete mode 100644 applications/utilities/errorEstimation/estimateScalarError/Make/files delete mode 100644 applications/utilities/errorEstimation/estimateScalarError/Make/options delete mode 100644 applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C delete mode 100644 applications/utilities/errorEstimation/icoErrorEstimate/Make/files delete mode 100644 applications/utilities/errorEstimation/icoErrorEstimate/Make/options delete mode 100644 applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C delete mode 100644 applications/utilities/errorEstimation/icoMomentError/Make/files delete mode 100644 applications/utilities/errorEstimation/icoMomentError/Make/options delete mode 100644 applications/utilities/errorEstimation/icoMomentError/icoMomentError.C delete mode 100644 applications/utilities/errorEstimation/momentScalarError/Make/files delete mode 100644 applications/utilities/errorEstimation/momentScalarError/Make/options delete mode 100644 applications/utilities/errorEstimation/momentScalarError/momentScalarError.C diff --git a/applications/utilities/errorEstimation/estimateScalarError/Make/files b/applications/utilities/errorEstimation/estimateScalarError/Make/files deleted file mode 100644 index a898536770..0000000000 --- a/applications/utilities/errorEstimation/estimateScalarError/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -estimateScalarError.C - -EXE = $(FOAM_APPBIN)/estimateScalarError diff --git a/applications/utilities/errorEstimation/estimateScalarError/Make/options b/applications/utilities/errorEstimation/estimateScalarError/Make/options deleted file mode 100644 index fa5bda2896..0000000000 --- a/applications/utilities/errorEstimation/estimateScalarError/Make/options +++ /dev/null @@ -1,9 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/errorEstimation/lnInclude - -EXE_LIBS = \ - -lerrorEstimation \ - -lfiniteVolume \ - -lmeshTools \ - -ldynamicMesh diff --git a/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C b/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C deleted file mode 100644 index 51d9b6bb40..0000000000 --- a/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C +++ /dev/null @@ -1,133 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - estimateScalarError - -Description - Estimates the error in the solution for a scalar transport equation in the - standard form - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "errorEstimate.H" -#include "resError.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - timeSelector::addOptions(); - -# include "setRootCase.H" -# include "createTime.H" - - instantList timeDirs = timeSelector::select0(runTime, args); - -# include "createMesh.H" - - Info<< "\nEstimating error in scalar transport equation\n" - << "Reading transportProperties\n" << endl; - - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - - Info<< "Reading diffusivity DT\n" << endl; - - dimensionedScalar DT - ( - transportProperties.lookup("DT") - ); - - - forAll(timeDirs, timeI) - { - runTime.setTime(timeDirs[timeI], timeI); - - Info<< "Time = " << runTime.timeName() << endl; - - mesh.readUpdate(); - - IOobject THeader - ( - "T", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - IOobject Uheader - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - if (THeader.headerOk() && Uheader.headerOk()) - { - Info<< "Reading T" << endl; - volScalarField T(THeader, mesh); - - Info<< "Reading U" << endl; - volVectorField U(Uheader, mesh); - -# include "createPhi.H" - - errorEstimate ee - ( - resError::div(phi, T) - - resError::laplacian(DT, T) - ); - - ee.residual()().write(); - volScalarField e(ee.error()); - e.write(); - mag(e)().write(); - } - else - { - Info<< " No T or U" << endl; - } - - Info<< endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/errorEstimation/icoErrorEstimate/Make/files b/applications/utilities/errorEstimation/icoErrorEstimate/Make/files deleted file mode 100644 index 45f2ec0d6f..0000000000 --- a/applications/utilities/errorEstimation/icoErrorEstimate/Make/files +++ /dev/null @@ -1,4 +0,0 @@ -icoErrorEstimate.C - -EXE = $(FOAM_APPBIN)/icoErrorEstimate - diff --git a/applications/utilities/errorEstimation/icoErrorEstimate/Make/options b/applications/utilities/errorEstimation/icoErrorEstimate/Make/options deleted file mode 100644 index e9a68290c0..0000000000 --- a/applications/utilities/errorEstimation/icoErrorEstimate/Make/options +++ /dev/null @@ -1,9 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/errorEstimation/lnInclude - -EXE_LIBS = \ - -lerrorEstimation \ - -lmeshTools \ - -ldynamicMesh \ - -lfiniteVolume diff --git a/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C b/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C deleted file mode 100644 index 233bddcb33..0000000000 --- a/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C +++ /dev/null @@ -1,129 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - icoErrorEstimate - -Description - Estimates error for the incompressible laminar CFD application icoFoam. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "errorEstimate.H" -#include "resError.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - timeSelector::addOptions(); - -# include "setRootCase.H" -# include "createTime.H" - - instantList timeDirs = timeSelector::select0(runTime, args); - -# include "createMesh.H" - - Info<< "\nEstimating error in the incompressible momentum equation\n" - << "Reading transportProperties\n" << endl; - - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar nu - ( - transportProperties.lookup("nu") - ); - - forAll(timeDirs, timeI) - { - runTime.setTime(timeDirs[timeI], timeI); - - Info<< "Time = " << runTime.timeName() << endl; - - mesh.readUpdate(); - - IOobject pHeader - ( - "p", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - IOobject Uheader - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - if (pHeader.headerOk() && Uheader.headerOk()) - { - Info<< "Reading p" << endl; - volScalarField p(pHeader, mesh); - - Info<< "Reading U" << endl; - volVectorField U(Uheader, mesh); - -# include "createPhi.H" - - errorEstimate ee - ( - resError::div(phi, U) - - resError::laplacian(nu, U) - == - -fvc::grad(p) - ); - - volVectorField e(ee.error()); - e.write(); - mag(e)().write(); - } - else - { - Info<< " No p or U" << endl; - } - - Info<< endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/errorEstimation/icoMomentError/Make/files b/applications/utilities/errorEstimation/icoMomentError/Make/files deleted file mode 100644 index d3285275de..0000000000 --- a/applications/utilities/errorEstimation/icoMomentError/Make/files +++ /dev/null @@ -1,4 +0,0 @@ -icoMomentError.C - -EXE = $(FOAM_APPBIN)/icoMomentError - diff --git a/applications/utilities/errorEstimation/icoMomentError/Make/options b/applications/utilities/errorEstimation/icoMomentError/Make/options deleted file mode 100644 index e9a68290c0..0000000000 --- a/applications/utilities/errorEstimation/icoMomentError/Make/options +++ /dev/null @@ -1,9 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/errorEstimation/lnInclude - -EXE_LIBS = \ - -lerrorEstimation \ - -lmeshTools \ - -ldynamicMesh \ - -lfiniteVolume diff --git a/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C b/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C deleted file mode 100644 index 508c6d0ab2..0000000000 --- a/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C +++ /dev/null @@ -1,188 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - icoMomentError - -Description - Estimates error for the incompressible laminar CFD application icoFoam. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "linear.H" -#include "gaussConvectionScheme.H" -#include "gaussLaplacianScheme.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - timeSelector::addOptions(); - -# include "setRootCase.H" -# include "createTime.H" - - instantList timeDirs = timeSelector::select0(runTime, args); - -# include "createMesh.H" - - Info<< "\nEstimating error in the incompressible momentum equation\n" - << "Reading transportProperties\n" << endl; - - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar nu - ( - transportProperties.lookup("nu") - ); - - forAll(timeDirs, timeI) - { - runTime.setTime(timeDirs[timeI], timeI); - - Info<< "Time = " << runTime.timeName() << endl; - - mesh.readUpdate(); - - IOobject pHeader - ( - "p", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - IOobject Uheader - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - if (pHeader.headerOk() && Uheader.headerOk()) - { - Info<< "Reading p" << endl; - volScalarField p(pHeader, mesh); - - Info<< "Reading U" << endl; - volVectorField U(Uheader, mesh); - -# include "createPhi.H" - - volScalarField ek(0.5*magSqr(U)); - volTensorField gradU(fvc::grad(U)); - - // Divergence of the error in U squared - - volScalarField L - ( - IOobject - ( - "L", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionedScalar("one", dimLength, 1.0) - ); - - L.internalField() = - mesh.V()/fvc::surfaceSum(mesh.magSf())().internalField(); - - // Warning: 4th row of this equation specially modified - // for the momentum equation. The "real" formulation would - // have diffusivity*(gradV && gradV) - volScalarField momError - ( - IOobject - ( - "momErrorL" + U.name(), - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - sqrt - ( - 2.0*mag - ( - ( - fv::gaussConvectionScheme - ( - mesh, - phi, - tmp > - ( - new linear(mesh) - ) - ).fvcDiv(phi, ek) - - - nu* - fv::gaussLaplacianScheme(mesh) - .fvcLaplacian - ( - ek - ) - - (U & fvc::grad(p)) -// + nu*(gradU && gradU) - + 0.5*nu* - ( - gradU && (gradU + gradU.T()) - ) - )*L/(mag(U) + nu/L) - ) - ) - ); - - momError.boundaryField() = 0.0; - momError.write(); - } - else - { - Info<< " No p or U" << endl; - } - - Info<< endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/errorEstimation/momentScalarError/Make/files b/applications/utilities/errorEstimation/momentScalarError/Make/files deleted file mode 100644 index 0fc18c6691..0000000000 --- a/applications/utilities/errorEstimation/momentScalarError/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -momentScalarError.C - -EXE = $(FOAM_APPBIN)/momentScalarError diff --git a/applications/utilities/errorEstimation/momentScalarError/Make/options b/applications/utilities/errorEstimation/momentScalarError/Make/options deleted file mode 100644 index e6f16fc705..0000000000 --- a/applications/utilities/errorEstimation/momentScalarError/Make/options +++ /dev/null @@ -1,8 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/errorEstimation/lnInclude - -EXE_LIBS = \ - -lmeshTools \ - -ldynamicMesh \ - -lfiniteVolume diff --git a/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C b/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C deleted file mode 100644 index 74ae1d5d1a..0000000000 --- a/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C +++ /dev/null @@ -1,185 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - momentScalarError - -Description - Estimates the error in the solution for a scalar transport equation in the - standard form - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "linear.H" -#include "gaussConvectionScheme.H" -#include "gaussLaplacianScheme.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - timeSelector::addOptions(); - -# include "setRootCase.H" -# include "createTime.H" - - instantList timeDirs = timeSelector::select0(runTime, args); - -# include "createMesh.H" - - Info<< "\nEstimating error in scalar transport equation\n" - << "Reading transportProperties\n" << endl; - - IOdictionary transportProperties - ( - IOobject - ( - "transportProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - - Info<< "Reading diffusivity DT\n" << endl; - - dimensionedScalar DT - ( - transportProperties.lookup("DT") - ); - - - forAll(timeDirs, timeI) - { - runTime.setTime(timeDirs[timeI], timeI); - - Info<< "Time = " << runTime.timeName() << endl; - - mesh.readUpdate(); - - IOobject THeader - ( - "T", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - IOobject Uheader - ( - "U", - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - if (THeader.headerOk() && Uheader.headerOk()) - { - Info<< "Reading T" << endl; - volScalarField T(THeader, mesh); - - Info<< "Reading U" << endl; - volVectorField U(Uheader, mesh); - -# include "createPhi.H" - - volVectorField gradT(fvc::grad(T)); - - volScalarField TE(0.5*sqr(T)); - - volScalarField L - ( - IOobject - ( - "L", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh, - dimensionedScalar("one", dimLength, 1.0) - ); - - L.internalField() = - mesh.V()/fvc::surfaceSum(mesh.magSf())().internalField(); - - // Divergence of the error in the T squared - volScalarField momError - ( - IOobject - ( - "momErrorL" + T.name(), - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - sqrt - ( - 2.0*mag - ( - ( - fv::gaussConvectionScheme - ( - mesh, - phi, - tmp > - ( - new linear(mesh) - ) - ).fvcDiv(phi, TE) - - - DT* - fv::gaussLaplacianScheme(mesh) - .fvcLaplacian - ( - TE - ) - + DT*(gradT & gradT) - )*L/(mag(U) + DT/L) - ) - ) - ); - - momError.boundaryField() = 0.0; - momError.write(); - } - else - { - Info<< " No T or U" << endl; - } - - Info<< endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options index e0635ddb6e..14c5e10a3e 100644 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options +++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options @@ -19,7 +19,6 @@ EXE_LIBS = \ -ldynamicMesh \ -ledgeMesh \ -lengine \ - -lerrorEstimation \ -lextrudeModel \ -lfieldFunctionObjects \ -lfileFormats \