From 7ea428af52177fbf71808e0e74d10cc23dc08dab Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 6 Apr 2018 13:06:36 +0100 Subject: [PATCH 1/3] cyclics: Removed unnecessary virtual inheritance of LduInterface classes --- .../cyclicGAMGInterfaceField.H | 2 +- .../cyclicGAMGInterface/cyclicGAMGInterface.H | 2 +- .../porousBafflePressureFvPatchField.C | 3 +-- .../constraint/cyclic/cyclicFvPatchField.C | 6 ++++-- .../constraint/cyclic/cyclicFvPatchField.H | 6 +++--- .../constraint/cyclicACMI/cyclicACMIFvPatchField.C | 12 ++++++------ .../constraint/cyclicACMI/cyclicACMIFvPatchField.H | 6 +++--- .../constraint/cyclicAMI/cyclicAMIFvPatchField.C | 12 ++++++------ .../constraint/cyclicAMI/cyclicAMIFvPatchField.H | 6 +++--- .../cyclicACMIGAMGInterfaceField.H | 2 +- .../cyclicAMIGAMGInterfaceField.H | 2 +- .../cyclicACMIGAMGInterface.H | 2 +- .../cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H | 4 ++-- 13 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H index 9f6cbba19d..07d819cb99 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H @@ -51,7 +51,7 @@ namespace Foam class cyclicGAMGInterfaceField : public GAMGInterfaceField, - virtual public cyclicLduInterfaceField + public cyclicLduInterfaceField { // Private data diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.H index 9773925b02..fecc7cf7c8 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.H @@ -50,7 +50,7 @@ namespace Foam class cyclicGAMGInterface : public GAMGInterface, - virtual public cyclicLduInterface + public cyclicLduInterface { // Private data diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C index d2fae8965a..38c8e95d86 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -88,7 +88,6 @@ Foam::porousBafflePressureFvPatchField::porousBafflePressureFvPatchField const porousBafflePressureFvPatchField& ptf ) : - cyclicLduInterfaceField(), fixedJumpFvPatchField(ptf), phiName_(ptf.phiName_), rhoName_(ptf.rhoName_), diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C index db36178e73..a8f7b9900f 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,6 +78,7 @@ Foam::cyclicFvPatchField::cyclicFvPatchField ) : coupledFvPatchField(ptf, p, iF, mapper), + cyclicLduInterfaceField(), cyclicPatch_(refCast(p)) { if (!isA(this->patch())) @@ -98,8 +99,8 @@ Foam::cyclicFvPatchField::cyclicFvPatchField const cyclicFvPatchField& ptf ) : - cyclicLduInterfaceField(), coupledFvPatchField(ptf), + cyclicLduInterfaceField(), cyclicPatch_(ptf.cyclicPatch_) {} @@ -112,6 +113,7 @@ Foam::cyclicFvPatchField::cyclicFvPatchField ) : coupledFvPatchField(ptf, iF), + cyclicLduInterfaceField(), cyclicPatch_(ptf.cyclicPatch_) {} diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H index 8122c21139..15ce65da27 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclic/cyclicFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,8 +69,8 @@ namespace Foam template class cyclicFvPatchField : - virtual public cyclicLduInterfaceField, - public coupledFvPatchField + public coupledFvPatchField, + public cyclicLduInterfaceField { // Private data diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C index 124c42fb87..79982c9c0e 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,8 +35,8 @@ Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField const DimensionedField& iF ) : - cyclicACMILduInterfaceField(), coupledFvPatchField(p, iF), + cyclicACMILduInterfaceField(), cyclicACMIPatch_(refCast(p)) {} @@ -49,8 +49,8 @@ Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField const dictionary& dict ) : - cyclicACMILduInterfaceField(), coupledFvPatchField(p, iF, dict, dict.found("value")), + cyclicACMILduInterfaceField(), cyclicACMIPatch_(refCast(p)) { if (!isA(p)) @@ -82,8 +82,8 @@ Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField const fvPatchFieldMapper& mapper ) : - cyclicACMILduInterfaceField(), coupledFvPatchField(ptf, p, iF, mapper), + cyclicACMILduInterfaceField(), cyclicACMIPatch_(refCast(p)) { if (!isA(this->patch())) @@ -105,8 +105,8 @@ Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField const cyclicACMIFvPatchField& ptf ) : - cyclicACMILduInterfaceField(), coupledFvPatchField(ptf), + cyclicACMILduInterfaceField(), cyclicACMIPatch_(ptf.cyclicACMIPatch_) {} @@ -118,8 +118,8 @@ Foam::cyclicACMIFvPatchField::cyclicACMIFvPatchField const DimensionedField& iF ) : - cyclicACMILduInterfaceField(), coupledFvPatchField(ptf, iF), + cyclicACMILduInterfaceField(), cyclicACMIPatch_(ptf.cyclicACMIPatch_) {} diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H index ebb2fb8cbd..7f7921dd94 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,8 +68,8 @@ namespace Foam template class cyclicACMIFvPatchField : - virtual public cyclicACMILduInterfaceField, - public coupledFvPatchField + public coupledFvPatchField, + public cyclicACMILduInterfaceField { // Private data diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C index 50f0b55938..f55a1b3af8 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,8 +32,8 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField const DimensionedField& iF ) : - cyclicAMILduInterfaceField(), coupledFvPatchField(p, iF), + cyclicAMILduInterfaceField(), cyclicAMIPatch_(refCast(p)) {} @@ -46,8 +46,8 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField const dictionary& dict ) : - cyclicAMILduInterfaceField(), coupledFvPatchField(p, iF, dict, dict.found("value")), + cyclicAMILduInterfaceField(), cyclicAMIPatch_(refCast(p)) { if (!isA(p)) @@ -79,8 +79,8 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField const fvPatchFieldMapper& mapper ) : - cyclicAMILduInterfaceField(), coupledFvPatchField(ptf, p, iF, mapper), + cyclicAMILduInterfaceField(), cyclicAMIPatch_(refCast(p)) { if (!isA(this->patch())) @@ -101,8 +101,8 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField const cyclicAMIFvPatchField& ptf ) : - cyclicAMILduInterfaceField(), coupledFvPatchField(ptf), + cyclicAMILduInterfaceField(), cyclicAMIPatch_(ptf.cyclicAMIPatch_) {} @@ -114,8 +114,8 @@ Foam::cyclicAMIFvPatchField::cyclicAMIFvPatchField const DimensionedField& iF ) : - cyclicAMILduInterfaceField(), coupledFvPatchField(ptf, iF), + cyclicAMILduInterfaceField(), cyclicAMIPatch_(ptf.cyclicAMIPatch_) {} diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H index 7ad7bddbb4..19606b1fb9 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicAMI/cyclicAMIFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,8 +73,8 @@ namespace Foam template class cyclicAMIFvPatchField : - virtual public cyclicAMILduInterfaceField, - public coupledFvPatchField + public coupledFvPatchField, + public cyclicAMILduInterfaceField { // Private data diff --git a/src/meshTools/AMIInterpolation/GAMG/interfaceFields/cyclicACMIGAMGInterfaceField/cyclicACMIGAMGInterfaceField.H b/src/meshTools/AMIInterpolation/GAMG/interfaceFields/cyclicACMIGAMGInterfaceField/cyclicACMIGAMGInterfaceField.H index 042a816a2b..fb6602103b 100644 --- a/src/meshTools/AMIInterpolation/GAMG/interfaceFields/cyclicACMIGAMGInterfaceField/cyclicACMIGAMGInterfaceField.H +++ b/src/meshTools/AMIInterpolation/GAMG/interfaceFields/cyclicACMIGAMGInterfaceField/cyclicACMIGAMGInterfaceField.H @@ -52,7 +52,7 @@ namespace Foam class cyclicACMIGAMGInterfaceField : public GAMGInterfaceField, - virtual public cyclicACMILduInterfaceField + public cyclicACMILduInterfaceField { // Private data diff --git a/src/meshTools/AMIInterpolation/GAMG/interfaceFields/cyclicAMIGAMGInterfaceField/cyclicAMIGAMGInterfaceField.H b/src/meshTools/AMIInterpolation/GAMG/interfaceFields/cyclicAMIGAMGInterfaceField/cyclicAMIGAMGInterfaceField.H index 1fd4750996..a933d00d03 100644 --- a/src/meshTools/AMIInterpolation/GAMG/interfaceFields/cyclicAMIGAMGInterfaceField/cyclicAMIGAMGInterfaceField.H +++ b/src/meshTools/AMIInterpolation/GAMG/interfaceFields/cyclicAMIGAMGInterfaceField/cyclicAMIGAMGInterfaceField.H @@ -51,7 +51,7 @@ namespace Foam class cyclicAMIGAMGInterfaceField : public GAMGInterfaceField, - virtual public cyclicAMILduInterfaceField + public cyclicAMILduInterfaceField { // Private data diff --git a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicACMIGAMGInterface/cyclicACMIGAMGInterface.H b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicACMIGAMGInterface/cyclicACMIGAMGInterface.H index bf471d830e..200ddc7397 100644 --- a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicACMIGAMGInterface/cyclicACMIGAMGInterface.H +++ b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicACMIGAMGInterface/cyclicACMIGAMGInterface.H @@ -50,7 +50,7 @@ namespace Foam class cyclicACMIGAMGInterface : public GAMGInterface, - virtual public cyclicACMILduInterface + public cyclicACMILduInterface { // Private data diff --git a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H index 6cc7600cac..2f085acd40 100644 --- a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H +++ b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,7 +50,7 @@ namespace Foam class cyclicAMIGAMGInterface : public GAMGInterface, - virtual public cyclicAMILduInterface + public cyclicAMILduInterface { // Private data From 8dcfc9e9f8e38c90755ba441f2da1850358f68e0 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 6 Apr 2018 16:46:12 +0100 Subject: [PATCH 2/3] streamLine: Added option to track in both directions Streamlines can now be tracked in both directions from the set of initial locations. The keyword controlling this behaviour is "direction", which can be set to "forward", "backward" or "both". This new keyword superseeds the "trackForward" entry, which has been retained for backwards compatibility. --- .../visualization/streamlines.cfg | 2 +- .../field/streamLine/streamLine.C | 37 +++++++++++++++++-- .../field/streamLine/streamLine.H | 25 +++++++++++-- .../field/streamLine/streamLineParticle.H | 4 +- .../motorBike/motorBike/system/controlDict | 2 +- .../motorBike/motorBike/system/streamLines | 4 +- .../simpleFoam/motorBike/system/streamLines | 4 +- .../pitzDailyExptInlet/system/controlDict | 4 +- 8 files changed, 66 insertions(+), 16 deletions(-) diff --git a/etc/caseDicts/postProcessing/visualization/streamlines.cfg b/etc/caseDicts/postProcessing/visualization/streamlines.cfg index 7d9e242c7e..e352ad963d 100644 --- a/etc/caseDicts/postProcessing/visualization/streamlines.cfg +++ b/etc/caseDicts/postProcessing/visualization/streamlines.cfg @@ -13,7 +13,7 @@ executeControl writeTime; writeControl writeTime; setFormat vtk; -trackForward true; +direction forward; lifeTime 10000; nSubCycle 5; diff --git a/src/functionObjects/field/streamLine/streamLine.C b/src/functionObjects/field/streamLine/streamLine.C index 355b8b9c19..4c87534971 100644 --- a/src/functionObjects/field/streamLine/streamLine.C +++ b/src/functionObjects/field/streamLine/streamLine.C @@ -45,6 +45,13 @@ namespace functionObjects { defineTypeNameAndDebug(streamLine, 0); addToRunTimeSelectionTable(functionObject, streamLine, dictionary); + + template<> + const char* NamedEnum::names[] = + {"forward", "backward", "both"}; + + const NamedEnum + streamLine::trackDirectionNames_; } } @@ -257,7 +264,9 @@ void Foam::functionObjects::streamLine::track() vsInterp, vvInterp, UIndex, // index of U in vvInterp - trackForward_, // track in +u direction? + + trackDirection_ == trackDirection::FORWARD, + nSubCycle_, // automatic track control:step through cells in steps? trackLength_, // fixed track length @@ -266,13 +275,24 @@ void Foam::functionObjects::streamLine::track() allVectors_ ); - // Set very large dt. Note: cannot use great since 1/great is small // which is a trigger value for the tracking... const scalar trackTime = Foam::sqrt(great); // Track + if (trackDirection_ == trackDirection::BOTH) + { + initialParticles = particles; + } + particles.move(particles, td, trackTime); + + if (trackDirection_ == trackDirection::BOTH) + { + particles.IDLList::operator=(initialParticles); + td.trackForward_ = !td.trackForward_; + particles.move(particles, td, trackTime); + } } @@ -321,8 +341,19 @@ bool Foam::functionObjects::streamLine::read(const dictionary& dict) << exit(FatalIOError); } + // The trackForward entry is maintained here for backwards compatibility + if (!dict.found("direction") && dict.found("trackForward")) + { + trackDirection_ = + dict.lookupType("trackForward") + ? trackDirection::FORWARD + : trackDirection::BACKWARD; + } + else + { + trackDirection_ = trackDirectionNames_[word(dict.lookup("direction"))]; + } - dict.lookup("trackForward") >> trackForward_; dict.lookup("lifeTime") >> lifeTime_; if (lifeTime_ < 1) { diff --git a/src/functionObjects/field/streamLine/streamLine.H b/src/functionObjects/field/streamLine/streamLine.H index b16f4109a7..46e27467e6 100644 --- a/src/functionObjects/field/streamLine/streamLine.H +++ b/src/functionObjects/field/streamLine/streamLine.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -112,6 +112,7 @@ SourceFiles #include "vectorList.H" #include "writer.H" #include "indirectPrimitivePatch.H" +#include "NamedEnum.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -133,6 +134,24 @@ class streamLine : public fvMeshFunctionObject { +public: + + // Public data types + + //- Track direction enumerations + enum trackDirection + { + FORWARD, + BACKWARD, + BOTH + }; + + //- Track direction enumeration names + static const NamedEnum trackDirectionNames_; + + +private: + // Private data //- Input dictionary @@ -147,8 +166,8 @@ class streamLine //- Interpolation scheme to use word interpolationScheme_; - //- Whether to use +u or -u - bool trackForward_; + //- The direction in which to track + trackDirection trackDirection_; //- Maximum lifetime (= number of cells) of particle label lifeTime_; diff --git a/src/functionObjects/field/streamLine/streamLineParticle.H b/src/functionObjects/field/streamLine/streamLineParticle.H index c19a188e4c..e9cd83aaae 100644 --- a/src/functionObjects/field/streamLine/streamLineParticle.H +++ b/src/functionObjects/field/streamLine/streamLineParticle.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,7 +77,7 @@ public: const label UIndex_; - const bool trackForward_; + bool trackForward_; const label nSubCycle_; diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/controlDict b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/controlDict index ab6ea48d40..10be98ae67 100644 --- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/controlDict +++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/controlDict @@ -54,7 +54,7 @@ functions type streamLine; writeControl writeTime; setFormat vtk; - trackForward true; + direction forward; fields (p U); lifeTime 10000; nSubCycle 5; diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/streamLines b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/streamLines index 1ca71c2522..d982472efa 100644 --- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/streamLines +++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/streamLines @@ -16,8 +16,8 @@ streamLines setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; //csv; //ensight; - // Tracked forwards (+U) or backwards (-U) - trackForward true; + // Track forward (+U) or backward (-U) or both + direction forward; // Names of fields to sample. Should contain above velocity field! fields (p U); diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/streamLines b/tutorials/incompressible/simpleFoam/motorBike/system/streamLines index 4c32d60804..6d8c403e49 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/streamLines +++ b/tutorials/incompressible/simpleFoam/motorBike/system/streamLines @@ -19,8 +19,8 @@ streamLines setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; //csv; //ensight; - // Tracked forwards (+U) or backwards (-U) - trackForward true; + // Track forward (+U) or backward (-U) or both + direction forward; // Names of fields to sample. Should contain above velocity field! fields (p U k); diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/controlDict b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/controlDict index d8f9467764..07fb098269 100644 --- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/controlDict +++ b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/controlDict @@ -60,8 +60,8 @@ functions setFormat vtk; //gnuplot;//xmgr;//raw;//jplot;//csv;//ensight; - // Tracked forwards (+U) or backwards (-U) - trackForward true; + // Track forward (+U) or backward (-U) or both + direction forward; // Names of fields to sample. Should contain above velocity field! fields (p k U); From b9d7740e1f184e515b1b3ff4cdaff28a1e46e822 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Mon, 9 Apr 2018 09:52:38 +0100 Subject: [PATCH 3/3] reactingEulerFoam: Update and instantiate interface composition models The nonRandomTwoLiquid and Roult interface composition models have been instantiated (and updated so that they compile), and a fuller set of multi-component liquids and multi-component and reacting gases have been used. The selection name of the saturated and nonRandomTwoLiquid models have also been changed to remove the capitalisation from the first letter, as is consistent with other sub-models that are not proper nouns. --- .../InterfaceCompositionModels.C | 82 ++++++++++++++++++- .../NonRandomTwoLiquid/NonRandomTwoLiquid.C | 2 +- .../NonRandomTwoLiquid/NonRandomTwoLiquid.H | 2 +- .../Saturated/Saturated.H | 2 +- .../constant/phaseProperties | 2 +- .../constant/phaseProperties | 2 +- .../constant/phaseProperties | 2 +- 7 files changed, 87 insertions(+), 7 deletions(-) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C index 422276d65b..4c74aeeb4f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/InterfaceCompositionModel/InterfaceCompositionModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,6 +58,8 @@ namespace Foam { using namespace interfaceCompositionModels; + // Gas-side models + // multi-component gas in the presence of a pure liquid makeInterfaceCompositionType ( @@ -99,6 +101,46 @@ namespace Foam multiComponentMixture, constFluidEThermoPhysics ); + makeSpecieInterfaceCompositionType + ( + NonRandomTwoLiquid, + heRhoThermo, + rhoReactionThermo, + multiComponentMixture, + constGasEThermoPhysics, + heRhoThermo, + rhoReactionThermo, + multiComponentMixture, + constFluidEThermoPhysics + ); + + // reacting gas in the presence of a multi-component liquid + makeSpecieInterfaceCompositionType + ( + Saturated, + heRhoThermo, + rhoReactionThermo, + reactingMixture, + constGasEThermoPhysics, + heRhoThermo, + rhoReactionThermo, + multiComponentMixture, + constFluidEThermoPhysics + ); + makeSpecieInterfaceCompositionType + ( + NonRandomTwoLiquid, + heRhoThermo, + rhoReactionThermo, + reactingMixture, + constGasEThermoPhysics, + heRhoThermo, + rhoReactionThermo, + multiComponentMixture, + constFluidEThermoPhysics + ); + + // Liquid-side models // multi-component liquid in the presence of a multi-component gas makeSpecieInterfaceCompositionType @@ -113,6 +155,44 @@ namespace Foam multiComponentMixture, constGasEThermoPhysics ); + makeSpecieInterfaceCompositionType + ( + Raoult, + heRhoThermo, + rhoReactionThermo, + multiComponentMixture, + constFluidEThermoPhysics, + heRhoThermo, + rhoReactionThermo, + multiComponentMixture, + constGasEThermoPhysics + ); + + // multi-component liquid in the presence of a reacting gas + makeSpecieInterfaceCompositionType + ( + Henry, + heRhoThermo, + rhoReactionThermo, + multiComponentMixture, + constFluidEThermoPhysics, + heRhoThermo, + rhoReactionThermo, + reactingMixture, + constGasEThermoPhysics + ); + makeSpecieInterfaceCompositionType + ( + Raoult, + heRhoThermo, + rhoReactionThermo, + multiComponentMixture, + constFluidEThermoPhysics, + heRhoThermo, + rhoReactionThermo, + reactingMixture, + constGasEThermoPhysics + ); } // ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C index 4a2af750c8..ff640f378d 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.C @@ -155,7 +155,7 @@ update const volScalarField& Tf ) { - volScalarField W(this->thermo_.composition().W()); + volScalarField W(this->thermo_.W()); volScalarField X1 ( diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H index d9b688aad7..c9a9019be1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/NonRandomTwoLiquid/NonRandomTwoLiquid.H @@ -110,7 +110,7 @@ class NonRandomTwoLiquid public: //- Runtime type information - TypeName("NonRandomTwoLiquid"); + TypeName("nonRandomTwoLiquid"); // Constructors diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H index 9f2c2e6233..1e1eba3d26 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialCompositionModels/interfaceCompositionModels/Saturated/Saturated.H @@ -82,7 +82,7 @@ protected: public: //- Runtime type information - TypeName("Saturated"); + TypeName("saturated"); // Constructors diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/phaseProperties index 1cbcbc71c6..887820e227 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/constant/phaseProperties @@ -137,7 +137,7 @@ interfaceComposition ( (gas in liquid) { - type Saturated; + type saturated; species ( H2O ); Le 1.0; saturationPressure diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/phaseProperties index 98af514eee..7d88afcf05 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/constant/phaseProperties @@ -137,7 +137,7 @@ interfaceComposition ( (gas in liquid) { - type Saturated; + type saturated; species ( H2O ); Le 1.0; saturationPressure diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/phaseProperties index 10a402fc08..f97b0c7f48 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/phaseProperties +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/constant/phaseProperties @@ -138,7 +138,7 @@ interfaceComposition ( (gas in liquid) { - type Saturated; + type saturated; species ( water ); Le 1.0; saturationPressure