This formulation provides C-grid like pressure-flux staggering on an unstructured mesh which is hugely beneficial for Euler-Euler multiphase equations as it allows for all forces to be treated in a consistent manner on the cell-faces which provides better balance, stability and accuracy. However, to achieve face-force consistency the momentum transport terms must be interpolated to the faces reducing accuracy of this part of the system but this is offset by the increase in accuracy of the force-balance. Currently it is not clear if this face-based momentum equation formulation is preferable for all Euler-Euler simulations so I have included it on a switch to allow evaluation and comparison with the previous cell-based formulation. To try the new algorithm simply switch it on, e.g.: PIMPLE { nOuterCorrectors 3; nCorrectors 1; nNonOrthogonalCorrectors 0; faceMomentum yes; } It is proving particularly good for bubbly flows, eliminating the staggering patterns often seen in the air velocity field with the previous algorithm, removing other spurious numerical artifacts in the velocity fields and improving stability and allowing larger time-steps For particle-gas flows the advantage is noticeable but not nearly as pronounced as in the bubbly flow cases. Please test the new algorithm on your cases and provide feedback. Henry G. Weller CFD Direct
139 lines
3.5 KiB
C
139 lines
3.5 KiB
C
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | Copyright (C) 2011-2015 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 "dragModel.H"
|
|
#include "phasePair.H"
|
|
#include "swarmCorrection.H"
|
|
#include "surfaceInterpolate.H"
|
|
|
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
|
|
namespace Foam
|
|
{
|
|
defineTypeNameAndDebug(dragModel, 0);
|
|
defineRunTimeSelectionTable(dragModel, dictionary);
|
|
}
|
|
|
|
const Foam::dimensionSet Foam::dragModel::dimK(1, -3, -1, 0, 0);
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
|
|
Foam::dragModel::dragModel
|
|
(
|
|
const phasePair& pair,
|
|
const bool registerObject
|
|
)
|
|
:
|
|
regIOobject
|
|
(
|
|
IOobject
|
|
(
|
|
IOobject::groupName(typeName, pair.name()),
|
|
pair.phase1().mesh().time().timeName(),
|
|
pair.phase1().mesh(),
|
|
IOobject::NO_READ,
|
|
IOobject::NO_WRITE,
|
|
registerObject
|
|
)
|
|
),
|
|
pair_(pair)
|
|
{}
|
|
|
|
|
|
Foam::dragModel::dragModel
|
|
(
|
|
const dictionary& dict,
|
|
const phasePair& pair,
|
|
const bool registerObject
|
|
)
|
|
:
|
|
regIOobject
|
|
(
|
|
IOobject
|
|
(
|
|
IOobject::groupName(typeName, pair.name()),
|
|
pair.phase1().mesh().time().timeName(),
|
|
pair.phase1().mesh(),
|
|
IOobject::NO_READ,
|
|
IOobject::NO_WRITE,
|
|
registerObject
|
|
)
|
|
),
|
|
pair_(pair),
|
|
swarmCorrection_
|
|
(
|
|
swarmCorrection::New
|
|
(
|
|
dict.subDict("swarmCorrection"),
|
|
pair
|
|
)
|
|
),
|
|
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha"))
|
|
{}
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
|
|
Foam::dragModel::~dragModel()
|
|
{}
|
|
|
|
|
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
|
|
Foam::tmp<Foam::volScalarField> Foam::dragModel::Ki() const
|
|
{
|
|
return
|
|
0.75
|
|
*CdRe()
|
|
*swarmCorrection_->Cs()
|
|
*pair_.continuous().rho()
|
|
*pair_.continuous().nu()
|
|
/sqr(pair_.dispersed().d());
|
|
}
|
|
|
|
|
|
Foam::tmp<Foam::volScalarField> Foam::dragModel::K() const
|
|
{
|
|
return max(pair_.dispersed(), residualAlpha_)*Ki();
|
|
}
|
|
|
|
|
|
Foam::tmp<Foam::surfaceScalarField> Foam::dragModel::Kf() const
|
|
{
|
|
return
|
|
max(fvc::interpolate(pair_.dispersed()), residualAlpha_)
|
|
*fvc::interpolate(Ki());
|
|
}
|
|
|
|
|
|
bool Foam::dragModel::writeData(Ostream& os) const
|
|
{
|
|
return os.good();
|
|
}
|
|
|
|
|
|
// ************************************************************************* //
|