Commit c937c4c9 authored by Henry's avatar Henry
Browse files

twoPhaseEulerFoam: Move the residualAlpha used for drag into the phaseModel

This is necessary to guarantee consistency between the residualAlpha
used for drag and buoyancy in a multi-phase system
parent 9bc5a92f
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "TomiyamaAspectRatio.H"
#include "orderedPhasePair.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -49,7 +49,7 @@ namespace aspectRatioModels
Foam::aspectRatioModels::TomiyamaAspectRatio::TomiyamaAspectRatio
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
)
:
VakhrushevEfremov(dict, pair),
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -74,7 +74,7 @@ public:
TomiyamaAspectRatio
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "VakhrushevEfremov.H"
#include "orderedPhasePair.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -33,7 +33,7 @@ namespace Foam
{
namespace aspectRatioModels
{
defineTypeNameAndDebug(VakhrushevEfremov, 0);
defineTypeNameAndDebug(VakhrushevEfremov, 0);
addToRunTimeSelectionTable
(
aspectRatioModel,
......@@ -49,7 +49,7 @@ namespace aspectRatioModels
Foam::aspectRatioModels::VakhrushevEfremov::VakhrushevEfremov
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
)
:
aspectRatioModel(dict, pair)
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -73,7 +73,7 @@ public:
VakhrushevEfremov
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "Wellek.H"
#include "orderedPhasePair.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -49,7 +49,7 @@ namespace aspectRatioModels
Foam::aspectRatioModels::Wellek::Wellek
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
)
:
aspectRatioModel(dict, pair)
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -79,7 +79,7 @@ public:
Wellek
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "aspectRatioModel.H"
#include "orderedPhasePair.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -40,7 +40,7 @@ namespace Foam
Foam::aspectRatioModel::aspectRatioModel
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
)
:
pair_(pair)
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -44,7 +44,7 @@ SourceFiles
namespace Foam
{
class orderedPhasePair;
class phasePair;
/*---------------------------------------------------------------------------*\
Class aspectRatioModel Declaration
......@@ -57,7 +57,7 @@ protected:
// Protected data
//- Phase pair
const orderedPhasePair& pair_;
const phasePair& pair_;
public:
......@@ -74,7 +74,7 @@ public:
dictionary,
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
),
(dict, pair)
);
......@@ -86,7 +86,7 @@ public:
aspectRatioModel
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
);
......@@ -99,7 +99,7 @@ public:
static autoPtr<aspectRatioModel> New
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,15 +24,15 @@ License
\*---------------------------------------------------------------------------*/
#include "aspectRatioModel.H"
#include "orderedPhasePair.H"
#include "phasePair.H"
// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::aspectRatioModel >
Foam::autoPtr<Foam::aspectRatioModel>
Foam::aspectRatioModel::New
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
)
{
word aspectRatioModelType(dict.lookup("type"));
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "constantAspectRatio.H"
#include "orderedPhasePair.H"
#include "phasePair.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -33,7 +33,7 @@ namespace Foam
{
namespace aspectRatioModels
{
defineTypeNameAndDebug(constantAspectRatio, 0);
defineTypeNameAndDebug(constantAspectRatio, 0);
addToRunTimeSelectionTable
(
aspectRatioModel,
......@@ -49,7 +49,7 @@ namespace aspectRatioModels
Foam::aspectRatioModels::constantAspectRatio::constantAspectRatio
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
)
:
aspectRatioModel(dict, pair),
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -70,7 +70,7 @@ public:
constantAspectRatio
(
const dictionary& dict,
const orderedPhasePair& pair
const phasePair& pair
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -34,7 +34,7 @@ namespace Foam
namespace dragModels
{
defineTypeNameAndDebug(Ergun, 0);
addToRunTimeSelectionTable(dragModel, Ergun, dictionary);
addToRunTimeSelectionTable(dragModel, Ergun, dictionary);
}
}
......@@ -66,8 +66,11 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::CdRe() const
(4/3)
*(
150
*max(scalar(1) - pair_.continuous(), residualAlpha_)
/max(pair_.continuous(), residualAlpha_)
*max
(
scalar(1) - pair_.continuous(),
pair_.continuous().residualAlpha()
)/max(pair_.continuous(), pair_.continuous().residualAlpha())
+ 1.75
*pair_.Re()
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -34,7 +34,7 @@ namespace Foam
namespace dragModels
{
defineTypeNameAndDebug(Gibilaro, 0);
addToRunTimeSelectionTable(dragModel, Gibilaro, dictionary);
addToRunTimeSelectionTable(dragModel, Gibilaro, dictionary);
}
}
......@@ -62,12 +62,15 @@ Foam::dragModels::Gibilaro::~Gibilaro()
Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::CdRe() const
{
volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_));
volScalarField alpha2
(
max(scalar(1) - pair_.dispersed(), pair_.continuous().residualAlpha())
);
return
(4/3)
*(17.3/alpha2 + 0.336*pair_.Re())
*max(pair_.continuous(), residualAlpha_)
*max(pair_.continuous(), pair_.continuous().residualAlpha())
*pow(alpha2, -2.8);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -64,8 +64,13 @@ Foam::dragModels::GidaspowSchillerNaumann::~GidaspowSchillerNaumann()
Foam::tmp<Foam::volScalarField>
Foam::dragModels::GidaspowSchillerNaumann::CdRe() const
{
volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_));
volScalarField alpha2
(
max(scalar(1) - pair_.dispersed(), pair_.continuous().residualAlpha())
);
volScalarField Re(alpha2*pair_.Re());
volScalarField CdsRe
(
neg(Re - 1000)*24.0*(1.0 + 0.15*pow(Re, 0.687))/alpha2
......@@ -75,7 +80,7 @@ Foam::dragModels::GidaspowSchillerNaumann::CdRe() const
return
CdsRe
*pow(alpha2, -2.65)
*max(pair_.continuous(), residualAlpha_);
*max(pair_.continuous(), pair_.continuous().residualAlpha());
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -34,7 +34,7 @@ namespace Foam
namespace dragModels
{
defineTypeNameAndDebug(SyamlalOBrien, 0);
addToRunTimeSelectionTable(dragModel, SyamlalOBrien, dictionary);
addToRunTimeSelectionTable(dragModel, SyamlalOBrien, dictionary);
}
}
......@@ -62,7 +62,11 @@ Foam::dragModels::SyamlalOBrien::~SyamlalOBrien()
Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::CdRe() const
{
volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_));
volScalarField alpha2
(
max(scalar(1) - pair_.dispersed(), pair_.continuous().residualAlpha())
);
volScalarField A(pow(alpha2, 4.14));
volScalarField B
(
......@@ -81,7 +85,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::SyamlalOBrien::CdRe() const
return
CdsRe
*max(pair_.continuous(), residualAlpha_)
*max(pair_.continuous(), pair_.continuous().residualAlpha())
/sqr(Vr);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -34,7 +34,7 @@ namespace Foam
namespace dragModels
{
defineTypeNameAndDebug(WenYu, 0);
addToRunTimeSelectionTable(dragModel, WenYu, dictionary);
addToRunTimeSelectionTable(dragModel, WenYu, dictionary);
}
}
......@@ -63,7 +63,11 @@ Foam::dragModels::WenYu::~WenYu()
Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::CdRe() const
{
volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_));
volScalarField alpha2
(
max(scalar(1) - pair_.dispersed(), pair_.continuous().residualAlpha())
);
volScalarField Re(pair_.Re());
volScalarField CdsRe
(
......@@ -74,7 +78,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::WenYu::CdRe() const
return
CdsRe
*pow(alpha2, -2.65)
*max(pair_.continuous(), residualAlpha_);
*max(pair_.continuous(), pair_.continuous().residualAlpha());
}
......
......@@ -90,8 +90,7 @@ Foam::dragModel::dragModel
dict.subDict("swarmCorrection"),
pair
)
),
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha"))
)
{}
......@@ -117,15 +116,18 @@ Foam::tmp<Foam::volScalarField> Foam::dragModel::Ki() const
Foam::tmp<Foam::volScalarField> Foam::dragModel::K() const
{
return max(pair_.dispersed(), residualAlpha_)*Ki();
return max(pair_.dispersed(), pair_.dispersed().residualAlpha())*Ki();
}
Foam::tmp<Foam::surfaceScalarField> Foam::dragModel::Kf() const
{
return
max(fvc::interpolate(pair_.dispersed()), residualAlpha_)
*fvc::interpolate(Ki());
max
(
fvc::interpolate(pair_.dispersed()),
pair_.dispersed().residualAlpha()
)*fvc::interpolate(Ki());
}
......
......@@ -65,9 +65,6 @@ protected:
//- Swarm correction
autoPtr<swarmCorrection> swarmCorrection_;
//- Residual phase fraction
const dimensionedScalar residualAlpha_;
public:
......@@ -130,13 +127,6 @@ public:
// Member Functions
//- Return the residual phase-fraction
// used to stabilize the phase momentum as the phase-fraction -> 0
const dimensionedScalar& residualAlpha() const
{
return residualAlpha_;
}
//- Drag coefficient
virtual tmp<volScalarField> CdRe() const = 0;
......
......@@ -112,7 +112,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
/max
(
alpha1 + alpha2,
residualAlpha_
pair_.phase1().residualAlpha() + pair_.phase2().residualAlpha()
)
);
volScalarField magGradI
......@@ -120,7 +120,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
max
(
mag(fvc::grad(I)),
residualAlpha_/L
(pair_.phase1().residualAlpha() + pair_.phase2().residualAlpha())/L
)
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -25,6 +25,8 @@ Class
Foam::heatTransferModels::RanzMarshall
Description
Ranz-Marshall correlation for turbulent heat transfer from the surface of a