From 76a910ab9fb3295dee28688e1df4fd4f74c2e00f Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 5 Nov 2015 19:53:43 +0000 Subject: [PATCH] reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair: Correct lookup of the aspectRatio Resolves bug-report http://openfoam.org/mantisbt/view.php?id=1899 --- .../constantAspectRatio/constantAspectRatio.C | 2 +- .../orderedPhasePair/orderedPhasePair.C | 12 ++------ .../orderedPhasePair/orderedPhasePair.H | 13 -------- .../phaseSystems/phaseSystem/phaseSystem.C | 30 +++++++++++++++++++ .../phaseSystems/phaseSystem/phaseSystem.H | 3 ++ 5 files changed, 36 insertions(+), 24 deletions(-) diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C index 386b06d6a..a670b67e4 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C @@ -77,7 +77,7 @@ Foam::aspectRatioModels::constantAspectRatio::E() const ( IOobject ( - "zero", + aspectRatioModel::typeName + ":E", mesh.time().timeName(), mesh ), diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C index 8c2bb470a..d6ea3da0b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "orderedPhasePair.H" -#include "aspectRatioModel.H" +#include "phaseSystem.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -73,15 +73,7 @@ Foam::word Foam::orderedPhasePair::name() const Foam::tmp Foam::orderedPhasePair::E() const { - return - phase1().mesh().lookupObject - ( - IOobject::groupName - ( - aspectRatioModel::typeName, - orderedPhasePair::name() - ) - ).E(); + return phase1().fluid().E(*this); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H index 4779fd333..be4e23261 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phasePair/orderedPhasePair/orderedPhasePair.H @@ -41,8 +41,6 @@ SourceFiles namespace Foam { -class aspectRatioModel; - /*---------------------------------------------------------------------------*\ Class orderedPhasePair Declaration \*---------------------------------------------------------------------------*/ @@ -51,17 +49,6 @@ class orderedPhasePair : public phasePair { - // Private data - - //- Aspect ratio model - autoPtr aspectRatio_; - - - // Private member functions - - //- Set the aspect ratio model, if there is one - void setAspectRatioModel(const dictTable aspectRatioTable); - public: diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C index aa9380758..4efd86189 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.C @@ -221,6 +221,36 @@ Foam::tmp Foam::phaseSystem::U() const } +Foam::tmp +Foam::phaseSystem::E(const phasePairKey& key) const +{ + if (aspectRatioModels_.found(key)) + { + return aspectRatioModels_[key]->E(); + } + else + { + return tmp + ( + new volScalarField + ( + IOobject + ( + aspectRatioModel::typeName + ":E", + this->mesh_.time().timeName(), + this->mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + this->mesh_, + dimensionedScalar("zero", dimless, 1) + ) + ); + } +} + + Foam::tmp Foam::phaseSystem::sigma(const phasePairKey& key) const { diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H index 001f1acdd..ba446ef32 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/phaseSystem/phaseSystem.H @@ -310,6 +310,9 @@ public: //- Access the rate of change of the pressure inline volScalarField& dpdt(); + //- Return the aspect-ratio + tmp E(const phasePairKey& key) const; + //- Return the surface tension coefficient tmp sigma(const phasePairKey& key) const;