mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
driftFluxFoam: Created special mixture viscosity framework for interacting phases
Added Thomas' slurry model
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
wclean libso viscosityModels
|
||||
wclean libso mixtureViscosityModels
|
||||
wclean libso relativeVelocityModels
|
||||
wclean
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
wmake libso viscosityModels
|
||||
wmake libso mixtureViscosityModels
|
||||
wmake libso relativeVelocityModels
|
||||
wmake
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C
|
||||
driftFluxFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/driftFluxFoam
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
EXE_INC = \
|
||||
-IincompressibleTwoPhaseInteractingMixture \
|
||||
-ImixtureViscosityModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
|
||||
@ -33,13 +33,13 @@
|
||||
// ~~~~~~~~~
|
||||
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
|
||||
incompressibleTwoPhaseInteractingMixture twoPhaseProperties(U, phi);
|
||||
|
||||
volScalarField& alpha1(twoPhaseProperties.alpha1());
|
||||
volScalarField& alpha2(twoPhaseProperties.alpha2());
|
||||
|
||||
const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
|
||||
const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
|
||||
const dimensionedScalar& rho1 = twoPhaseProperties.rhod();
|
||||
const dimensionedScalar& rho2 = twoPhaseProperties.rhoc();
|
||||
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
|
||||
@ -36,7 +36,7 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "CMULES.H"
|
||||
#include "subCycle.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "incompressibleTwoPhaseInteractingMixture.H"
|
||||
#include "relativeVelocityModel.H"
|
||||
#include "nearWallDist.H"
|
||||
#include "wallFvPatch.H"
|
||||
@ -87,6 +87,7 @@ int main(int argc, char *argv[])
|
||||
#include "alphaEqnSubCycle.H"
|
||||
|
||||
twoPhaseProperties.correct();
|
||||
Info<< average(twoPhaseProperties.mu()) << endl;
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
|
||||
@ -0,0 +1,135 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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 "incompressibleTwoPhaseInteractingMixture.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "fvc.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(incompressibleTwoPhaseInteractingMixture, 0);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::incompressibleTwoPhaseInteractingMixture::
|
||||
incompressibleTwoPhaseInteractingMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
U.time().constant(),
|
||||
U.db(),
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
twoPhaseMixture(U.mesh(), *this),
|
||||
|
||||
muModel_
|
||||
(
|
||||
mixtureViscosityModel::New
|
||||
(
|
||||
"mu",
|
||||
subDict(phase1Name_),
|
||||
U,
|
||||
phi
|
||||
)
|
||||
),
|
||||
|
||||
nucModel_
|
||||
(
|
||||
viscosityModel::New
|
||||
(
|
||||
"nuc",
|
||||
subDict(phase2Name_),
|
||||
U,
|
||||
phi
|
||||
)
|
||||
),
|
||||
|
||||
rhod_("rho", dimDensity, muModel_->viscosityProperties().lookup("rho")),
|
||||
rhoc_("rho", dimDensity, nucModel_->viscosityProperties().lookup("rho")),
|
||||
|
||||
U_(U),
|
||||
phi_(phi),
|
||||
|
||||
mu_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
U_.time().timeName(),
|
||||
U_.db()
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar("mu", dimensionSet(1, -1, -1, 0, 0), 0),
|
||||
calculatedFvPatchScalarField::typeName
|
||||
)
|
||||
{
|
||||
correct();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::incompressibleTwoPhaseInteractingMixture::read()
|
||||
{
|
||||
if (regIOobject::read())
|
||||
{
|
||||
if
|
||||
(
|
||||
muModel_().read(subDict(phase1Name_))
|
||||
&& nucModel_().read(subDict(phase2Name_))
|
||||
)
|
||||
{
|
||||
muModel_->viscosityProperties().lookup("rho") >> rhod_;
|
||||
nucModel_->viscosityProperties().lookup("rho") >> rhoc_;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,172 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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/>.
|
||||
|
||||
Class
|
||||
Foam::incompressibleTwoPhaseInteractingMixture
|
||||
|
||||
Description
|
||||
A two-phase incompressible transportModel for interacting phases
|
||||
requiring the direct evaluation of the mixture viscosity,
|
||||
e.g. activated sludge or slurry.
|
||||
|
||||
SourceFiles
|
||||
incompressibleTwoPhaseInteractingMixture.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef incompressibleTwoPhaseInteractingMixture_H
|
||||
#define incompressibleTwoPhaseInteractingMixture_H
|
||||
|
||||
#include "incompressible/transportModel/transportModel.H"
|
||||
#include "incompressible/viscosityModels/viscosityModel/viscosityModel.H"
|
||||
#include "mixtureViscosityModel.H"
|
||||
#include "twoPhaseMixture.H"
|
||||
#include "IOdictionary.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class incompressibleTwoPhaseInteractingMixture Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class incompressibleTwoPhaseInteractingMixture
|
||||
:
|
||||
public IOdictionary,
|
||||
public transportModel,
|
||||
public twoPhaseMixture
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
autoPtr<mixtureViscosityModel> muModel_;
|
||||
autoPtr<viscosityModel> nucModel_;
|
||||
|
||||
dimensionedScalar rhod_;
|
||||
dimensionedScalar rhoc_;
|
||||
|
||||
const volVectorField& U_;
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
volScalarField mu_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
TypeName("incompressibleTwoPhaseInteractingMixture");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
incompressibleTwoPhaseInteractingMixture
|
||||
(
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~incompressibleTwoPhaseInteractingMixture()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return const-access to the mixture viscosityModel
|
||||
const mixtureViscosityModel& muModel() const
|
||||
{
|
||||
return muModel_();
|
||||
}
|
||||
|
||||
//- Return const-access to the continuous-phase viscosityModel
|
||||
const viscosityModel& nucModel() const
|
||||
{
|
||||
return nucModel_();
|
||||
}
|
||||
|
||||
//- Return const-access to the dispersed-phase density
|
||||
const dimensionedScalar& rhod() const
|
||||
{
|
||||
return rhod_;
|
||||
}
|
||||
|
||||
//- Return const-access to continuous-phase density
|
||||
const dimensionedScalar& rhoc() const
|
||||
{
|
||||
return rhoc_;
|
||||
};
|
||||
|
||||
//- Return const-access to the mixture velocity
|
||||
const volVectorField& U() const
|
||||
{
|
||||
return U_;
|
||||
}
|
||||
|
||||
//- Return the dynamic mixture viscosity
|
||||
tmp<volScalarField> mu() const
|
||||
{
|
||||
return mu_;
|
||||
}
|
||||
|
||||
//- Return the mixture viscosity
|
||||
virtual tmp<volScalarField> nu() const
|
||||
{
|
||||
notImplemented("incompressibleTwoPhaseInteractingMixture::nu()");
|
||||
return volScalarField::null();
|
||||
}
|
||||
|
||||
//- Return the mixture viscosity for patch
|
||||
virtual tmp<scalarField> nu(const label patchi) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"incompressibleTwoPhaseInteractingMixture::nu(const label)"
|
||||
);
|
||||
return scalarField::null();
|
||||
}
|
||||
|
||||
//- Correct the laminar viscosity
|
||||
virtual void correct()
|
||||
{
|
||||
mu_ = muModel_->mu(rhoc_*nucModel_->nu());
|
||||
}
|
||||
|
||||
//- Read base transportProperties dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -21,7 +21,7 @@ if (turbulence)
|
||||
Cmu*k/sigmak*(g & fvc::grad(rho))/(epsilon + epsilonMin)
|
||||
);
|
||||
|
||||
volScalarField muc(twoPhaseProperties.nuModel2().nu()*rho2);
|
||||
volScalarField muc(twoPhaseProperties.nucModel().nu()*rho2);
|
||||
|
||||
#include "wallFunctions.H"
|
||||
|
||||
|
||||
@ -25,20 +25,19 @@ License
|
||||
|
||||
#include "BinghamPlastic.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "fvc.H"
|
||||
#include "fvcGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace viscosityModels
|
||||
namespace mixtureViscosityModels
|
||||
{
|
||||
defineTypeNameAndDebug(BinghamPlastic, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
viscosityModel,
|
||||
mixtureViscosityModel,
|
||||
BinghamPlastic,
|
||||
dictionary
|
||||
);
|
||||
@ -46,18 +45,48 @@ namespace viscosityModels
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::mixtureViscosityModels::BinghamPlastic::BinghamPlastic
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
plastic(name, viscosityProperties, U, phi, typeName),
|
||||
yieldStressCoeff_
|
||||
(
|
||||
"BinghamCoeff",
|
||||
dimensionSet(1, -1, -2, 0, 0),
|
||||
plasticCoeffs_.lookup("BinghamCoeff")
|
||||
),
|
||||
yieldStressExponent_
|
||||
(
|
||||
"BinghamExponent",
|
||||
dimless,
|
||||
plasticCoeffs_.lookup("BinghamExponent")
|
||||
),
|
||||
yieldStressOffset_
|
||||
(
|
||||
"BinghamOffset",
|
||||
dimless,
|
||||
plasticCoeffs_.lookup("BinghamOffset")
|
||||
),
|
||||
U_(U)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::viscosityModels::BinghamPlastic::correctionNu
|
||||
Foam::mixtureViscosityModels::BinghamPlastic::mu
|
||||
(
|
||||
const dimensionedScalar& rhoc,
|
||||
const dimensionedScalar& rhop,
|
||||
const volScalarField& nuc
|
||||
const volScalarField& muc
|
||||
) const
|
||||
{
|
||||
volScalarField
|
||||
tauy
|
||||
volScalarField tauy
|
||||
(
|
||||
yieldStressCoeff_
|
||||
*(
|
||||
@ -75,45 +104,24 @@ Foam::viscosityModels::BinghamPlastic::correctionNu
|
||||
)
|
||||
);
|
||||
|
||||
volScalarField
|
||||
nup
|
||||
(
|
||||
plastic::correctionNu(rhoc, rhop, nuc)
|
||||
);
|
||||
volScalarField mup(plastic::mu(muc));
|
||||
|
||||
dimensionedScalar tauySmall("tauySmall", tauy.dimensions(), SMALL);
|
||||
|
||||
return
|
||||
return min
|
||||
(
|
||||
tauy
|
||||
/(
|
||||
mag(fvc::grad(U_))
|
||||
+ 1.0e-4*(tauy + tauySmall)/(nup + (rhoc/rhop)*nuc)
|
||||
+ 1.0e-4*(tauy + tauySmall)/mup
|
||||
)
|
||||
+ nup;
|
||||
+ mup,
|
||||
muMax_
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::viscosityModels::BinghamPlastic::BinghamPlastic
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
plastic(name, viscosityProperties, U, phi, typeName),
|
||||
yieldStressCoeff_(plasticCoeffs_.lookup("yieldStressCoeff")),
|
||||
yieldStressExponent_(plasticCoeffs_.lookup("yieldStressExponent")),
|
||||
yieldStressOffset_(plasticCoeffs_.lookup("yieldStressOffset")),
|
||||
U_(U)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::viscosityModels::BinghamPlastic::read
|
||||
bool Foam::mixtureViscosityModels::BinghamPlastic::read
|
||||
(
|
||||
const dictionary& viscosityProperties
|
||||
)
|
||||
@ -22,7 +22,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::viscosityModels::BinghamPlastic
|
||||
Foam::mixtureViscosityModels::BinghamPlastic
|
||||
|
||||
Description
|
||||
Viscosity correction model for Bingham plastics.
|
||||
@ -41,7 +41,7 @@ SourceFiles
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace viscosityModels
|
||||
namespace mixtureViscosityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -69,17 +69,6 @@ protected:
|
||||
const volVectorField& U_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Calculate and return the laminar viscosity correction
|
||||
virtual tmp<volScalarField> correctionNu
|
||||
(
|
||||
const dimensionedScalar& rhoc,
|
||||
const dimensionedScalar& rhop,
|
||||
const volScalarField& nuc
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -105,6 +94,10 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the mixture viscosity
|
||||
// given the viscosity of the continuous phase
|
||||
tmp<volScalarField> mu(const volScalarField& muc) const;
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& viscosityProperties);
|
||||
};
|
||||
@ -112,7 +105,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace viscosityModels
|
||||
} // End namespace mixtureViscosityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -0,0 +1,7 @@
|
||||
mixtureViscosityModel/mixtureViscosityModel.C
|
||||
mixtureViscosityModel/mixtureViscosityModelNew.C
|
||||
plastic/plastic.C
|
||||
BinghamPlastic/BinghamPlastic.C
|
||||
slurry/slurry.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libdriftFluxTransportModels
|
||||
@ -1,4 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I../incompressibleTwoPhaseInteractingMixture \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
@ -0,0 +1,65 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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 "mixtureViscosityModel.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(mixtureViscosityModel, 0);
|
||||
defineRunTimeSelectionTable(mixtureViscosityModel, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::mixtureViscosityModel::mixtureViscosityModel
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
viscosityProperties_(viscosityProperties),
|
||||
U_(U),
|
||||
phi_(phi)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::mixtureViscosityModel::read(const dictionary& viscosityProperties)
|
||||
{
|
||||
viscosityProperties_ = viscosityProperties;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,165 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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/>.
|
||||
|
||||
Namespace
|
||||
Foam::mixtureViscosityModels
|
||||
|
||||
Description
|
||||
A namespace for incompressible mixtureViscosityModel implementations.
|
||||
|
||||
Class
|
||||
Foam::mixtureViscosityModel
|
||||
|
||||
Description
|
||||
An abstract base class for incompressible mixtureViscosityModels.
|
||||
|
||||
The strain rate is defined by:
|
||||
|
||||
mag(symm(grad(U)))
|
||||
|
||||
|
||||
SourceFiles
|
||||
mixtureViscosityModel.C
|
||||
mixtureViscosityModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef mixtureViscosityModel_H
|
||||
#define mixtureViscosityModel_H
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class mixtureViscosityModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class mixtureViscosityModel
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
word name_;
|
||||
dictionary viscosityProperties_;
|
||||
|
||||
const volVectorField& U_;
|
||||
const surfaceScalarField& phi_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow copy construct
|
||||
mixtureViscosityModel(const mixtureViscosityModel&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const mixtureViscosityModel&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("mixtureViscosityModel");
|
||||
|
||||
|
||||
// Declare run-time constructor selection table
|
||||
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
mixtureViscosityModel,
|
||||
dictionary,
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
),
|
||||
(name, viscosityProperties, U, phi)
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
//- Return a reference to the selected viscosity model
|
||||
static autoPtr<mixtureViscosityModel> New
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
mixtureViscosityModel
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~mixtureViscosityModel()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the phase transport properties dictionary
|
||||
const dictionary& viscosityProperties() const
|
||||
{
|
||||
return viscosityProperties_;
|
||||
}
|
||||
|
||||
//- Return the mixture viscosity
|
||||
// given the viscosity of the continuous phase
|
||||
virtual tmp<volScalarField> mu(const volScalarField& muc) const = 0;
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
virtual bool read(const dictionary& viscosityProperties) = 0;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,65 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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 "mixtureViscosityModel.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::autoPtr<Foam::mixtureViscosityModel> Foam::mixtureViscosityModel::New
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi
|
||||
)
|
||||
{
|
||||
const word modelType(viscosityProperties.lookup("transportModel"));
|
||||
|
||||
Info<< "Selecting incompressible transport model " << modelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(modelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"mixtureViscosityModel::New(const volVectorField&, "
|
||||
"const surfaceScalarField&)"
|
||||
) << "Unknown mixtureViscosityModel type "
|
||||
<< modelType << nl << nl
|
||||
<< "Valid mixtureViscosityModels are : " << endl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<mixtureViscosityModel>
|
||||
(cstrIter()(name, viscosityProperties, U, phi));
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -25,20 +25,18 @@ License
|
||||
|
||||
#include "plastic.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "surfaceFields.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace viscosityModels
|
||||
namespace mixtureViscosityModels
|
||||
{
|
||||
defineTypeNameAndDebug(plastic, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
viscosityModel,
|
||||
mixtureViscosityModel,
|
||||
plastic,
|
||||
dictionary
|
||||
);
|
||||
@ -46,90 +44,9 @@ namespace viscosityModels
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::viscosityModels::plastic::calcNu() const
|
||||
{
|
||||
const incompressibleTwoPhaseMixture& twoPhaseProperties =
|
||||
alpha_.mesh().lookupObject<incompressibleTwoPhaseMixture>
|
||||
(
|
||||
"transportProperties"
|
||||
);
|
||||
|
||||
bool isThisIsPhase1(&twoPhaseProperties.nuModel1() == this);
|
||||
|
||||
dimensionedScalar
|
||||
rhoc
|
||||
(
|
||||
isThisIsPhase1
|
||||
? twoPhaseProperties.rho2()
|
||||
: twoPhaseProperties.rho1()
|
||||
);
|
||||
|
||||
dimensionedScalar
|
||||
rhop
|
||||
(
|
||||
isThisIsPhase1
|
||||
? twoPhaseProperties.rho1()
|
||||
: twoPhaseProperties.rho2()
|
||||
);
|
||||
|
||||
volScalarField
|
||||
nuc
|
||||
(
|
||||
(
|
||||
isThisIsPhase1
|
||||
? twoPhaseProperties.nuModel2()
|
||||
: twoPhaseProperties.nuModel1()
|
||||
).nu()
|
||||
);
|
||||
|
||||
volScalarField
|
||||
nup
|
||||
(
|
||||
correctionNu(rhoc, rhop, nuc)
|
||||
);
|
||||
|
||||
return
|
||||
max
|
||||
(
|
||||
nuMin_,
|
||||
min
|
||||
(
|
||||
nuMax_,
|
||||
(
|
||||
nup + (rhoc/rhop)*nuc*alpha_
|
||||
)
|
||||
)
|
||||
)
|
||||
/max(alpha_, SMALL);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::viscosityModels::plastic::correctionNu
|
||||
(
|
||||
const dimensionedScalar& rhoc,
|
||||
const dimensionedScalar& rhop,
|
||||
const volScalarField& nuc
|
||||
) const
|
||||
{
|
||||
return
|
||||
plasticViscosityCoeff_
|
||||
*(
|
||||
pow
|
||||
(
|
||||
scalar(10),
|
||||
plasticViscosityExponent_*alpha_
|
||||
) - scalar(1)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::viscosityModels::plastic::plastic
|
||||
Foam::mixtureViscosityModels::plastic::plastic
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
@ -138,18 +55,26 @@ Foam::viscosityModels::plastic::plastic
|
||||
const word modelName
|
||||
)
|
||||
:
|
||||
viscosityModel(name, viscosityProperties, U, phi),
|
||||
mixtureViscosityModel(name, viscosityProperties, U, phi),
|
||||
plasticCoeffs_(viscosityProperties.subDict(modelName + "Coeffs")),
|
||||
plasticViscosityCoeff_
|
||||
(
|
||||
plasticCoeffs_.lookup("plasticViscosityCoeff")
|
||||
"coeff",
|
||||
dimensionSet(1, -1, -1, 0, 0),
|
||||
plasticCoeffs_.lookup("coeff")
|
||||
),
|
||||
plasticViscosityExponent_
|
||||
(
|
||||
plasticCoeffs_.lookup("plasticViscosityExponent")
|
||||
"exponent",
|
||||
dimless,
|
||||
plasticCoeffs_.lookup("exponent")
|
||||
),
|
||||
muMax_
|
||||
(
|
||||
"muMax",
|
||||
dimensionSet(1, -1, -1, 0, 0),
|
||||
plasticCoeffs_.lookup("muMax")
|
||||
),
|
||||
nuMin_(plasticCoeffs_.lookup("nuMin")),
|
||||
nuMax_(plasticCoeffs_.lookup("nuMax")),
|
||||
alpha_
|
||||
(
|
||||
U.mesh().lookupObject<volScalarField>
|
||||
@ -160,38 +85,43 @@ Foam::viscosityModels::plastic::plastic
|
||||
viscosityProperties.dictName()
|
||||
)
|
||||
)
|
||||
),
|
||||
nu_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
name,
|
||||
U_.time().timeName(),
|
||||
U_.db(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
U_.mesh(),
|
||||
dimensionedScalar("nu", dimViscosity, 0)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::viscosityModels::plastic::read
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::mixtureViscosityModels::plastic::mu(const volScalarField& muc) const
|
||||
{
|
||||
return min
|
||||
(
|
||||
muc
|
||||
+ plasticViscosityCoeff_
|
||||
*(
|
||||
pow
|
||||
(
|
||||
scalar(10),
|
||||
plasticViscosityExponent_*alpha_
|
||||
) - scalar(1)
|
||||
),
|
||||
muMax_
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::mixtureViscosityModels::plastic::read
|
||||
(
|
||||
const dictionary& viscosityProperties
|
||||
)
|
||||
{
|
||||
viscosityModel::read(viscosityProperties);
|
||||
mixtureViscosityModel::read(viscosityProperties);
|
||||
|
||||
plasticCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs");
|
||||
|
||||
plasticCoeffs_.lookup("k") >> plasticViscosityCoeff_;
|
||||
plasticCoeffs_.lookup("n") >> plasticViscosityExponent_;
|
||||
plasticCoeffs_.lookup("nuMin") >> nuMin_;
|
||||
plasticCoeffs_.lookup("nuMax") >> nuMax_;
|
||||
plasticCoeffs_.lookup("muMax") >> muMax_;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -22,7 +22,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::viscosityModels::plastic
|
||||
Foam::mixtureViscosityModels::plastic
|
||||
|
||||
Description
|
||||
Viscosity correction model for a generic power-law plastic.
|
||||
@ -35,7 +35,7 @@ SourceFiles
|
||||
#ifndef plastic_H
|
||||
#define plastic_H
|
||||
|
||||
#include "viscosityModel.H"
|
||||
#include "mixtureViscosityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "volFields.H"
|
||||
|
||||
@ -44,9 +44,9 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class incompressibleTwoPhaseMixture;
|
||||
class incompressibleTwoPhaseInteractingMixture;
|
||||
|
||||
namespace viscosityModels
|
||||
namespace mixtureViscosityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -55,7 +55,7 @@ namespace viscosityModels
|
||||
|
||||
class plastic
|
||||
:
|
||||
public viscosityModel
|
||||
public mixtureViscosityModel
|
||||
{
|
||||
protected:
|
||||
|
||||
@ -70,32 +70,12 @@ protected:
|
||||
//- Plastic viscosity exponent
|
||||
dimensionedScalar plasticViscosityExponent_;
|
||||
|
||||
//- Minimum viscosity
|
||||
dimensionedScalar nuMin_;
|
||||
|
||||
//- Maximum viscosity
|
||||
dimensionedScalar nuMax_;
|
||||
dimensionedScalar muMax_;
|
||||
|
||||
//- Plastic phase fraction
|
||||
const volScalarField& alpha_;
|
||||
|
||||
//- Viscosity
|
||||
volScalarField nu_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Calculate and return the laminar viscosity
|
||||
virtual tmp<volScalarField> calcNu() const;
|
||||
|
||||
//- Calculate and return the laminar viscosity correction
|
||||
virtual tmp<volScalarField> correctionNu
|
||||
(
|
||||
const dimensionedScalar& rhoc,
|
||||
const dimensionedScalar& rhop,
|
||||
const volScalarField& nuc
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -123,23 +103,9 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the laminar viscosity
|
||||
tmp<volScalarField> nu() const
|
||||
{
|
||||
return nu_;
|
||||
}
|
||||
|
||||
//- Return the laminar viscosity for patch
|
||||
tmp<scalarField> nu(const label patchi) const
|
||||
{
|
||||
return nu_.boundaryField()[patchi];
|
||||
}
|
||||
|
||||
//- Correct the laminar viscosity
|
||||
void correct()
|
||||
{
|
||||
nu_ = calcNu();
|
||||
}
|
||||
//- Return the mixture viscosity
|
||||
// given the viscosity of the continuous phase
|
||||
tmp<volScalarField> mu(const volScalarField& muc) const;
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& viscosityProperties);
|
||||
@ -148,7 +114,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace viscosityModels
|
||||
} // End namespace mixtureViscosityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -0,0 +1,94 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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 "slurry.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace mixtureViscosityModels
|
||||
{
|
||||
defineTypeNameAndDebug(slurry, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
mixtureViscosityModel,
|
||||
slurry,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::mixtureViscosityModels::slurry::slurry
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word modelName
|
||||
)
|
||||
:
|
||||
mixtureViscosityModel(name, viscosityProperties, U, phi),
|
||||
alpha_
|
||||
(
|
||||
U.mesh().lookupObject<volScalarField>
|
||||
(
|
||||
IOobject::groupName
|
||||
(
|
||||
viscosityProperties.lookupOrDefault<word>("alpha", "alpha"),
|
||||
viscosityProperties.dictName()
|
||||
)
|
||||
)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::volScalarField>
|
||||
Foam::mixtureViscosityModels::slurry::mu(const volScalarField& muc) const
|
||||
{
|
||||
return
|
||||
(
|
||||
muc*(1.0 + 2.5*alpha_ + 10.05*sqr(alpha_) + 0.00273*exp(16.6*alpha_))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::mixtureViscosityModels::slurry::read
|
||||
(
|
||||
const dictionary& viscosityProperties
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,121 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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/>.
|
||||
|
||||
Class
|
||||
Foam::mixtureViscosityModels::slurry
|
||||
|
||||
Description
|
||||
Thomas' viscosity correction for slurry.
|
||||
|
||||
References:
|
||||
\verbatim
|
||||
"Transport characteristics of suspension:
|
||||
VIII. A note on the viscosity of Newtonian suspensions
|
||||
of uniform spherical particles".
|
||||
D.G. Thomas,
|
||||
J. Colloid Sci. 20 (3), 1965, p267.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
slurry.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef slurry_H
|
||||
#define slurry_H
|
||||
|
||||
#include "mixtureViscosityModel.H"
|
||||
#include "dimensionedScalar.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class incompressibleTwoPhaseInteractingMixture;
|
||||
|
||||
namespace mixtureViscosityModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class slurry Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class slurry
|
||||
:
|
||||
public mixtureViscosityModel
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Slurry phase fraction
|
||||
const volScalarField& alpha_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("slurry");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
slurry
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& viscosityProperties,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& phi,
|
||||
const word modelName=typeName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
~slurry()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the mixture viscosity
|
||||
// given the viscosity of the continuous phase
|
||||
tmp<volScalarField> mu(const volScalarField& muc) const;
|
||||
|
||||
//- Read transportProperties dictionary
|
||||
bool read(const dictionary& viscosityProperties);
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace mixtureViscosityModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,4 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I../incompressibleTwoPhaseInteractingMixture \
|
||||
-I../mixtureViscosityModels/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
|
||||
|
||||
@ -43,13 +43,13 @@ namespace relativeVelocityModels
|
||||
Foam::relativeVelocityModels::general::general
|
||||
(
|
||||
const dictionary& dict,
|
||||
const incompressibleTwoPhaseMixture& mixture
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture
|
||||
)
|
||||
:
|
||||
relativeVelocityModel(dict, mixture),
|
||||
a_(dict.lookup("a")),
|
||||
a1_(dict.lookup("a1")),
|
||||
V0_(dict.lookup("V0")),
|
||||
a_("a", dimless, dict.lookup("a")),
|
||||
a1_("a1", dimless, dict.lookup("a1")),
|
||||
V0_("V0", dimVelocity, dict.lookup("V0")),
|
||||
residualAlpha_(dict.lookup("residualAlpha"))
|
||||
{}
|
||||
|
||||
@ -65,13 +65,13 @@ Foam::relativeVelocityModels::general::~general()
|
||||
void Foam::relativeVelocityModels::general::correct()
|
||||
{
|
||||
Udm_ =
|
||||
(rhoC_/rho())
|
||||
(rhoc_/rho())
|
||||
*V0_
|
||||
*(
|
||||
exp(-a_*max(alphaD_ - residualAlpha_, scalar(0)))
|
||||
- exp(-a1_*max(alphaD_ - residualAlpha_, scalar(0)))
|
||||
exp(-a_*max(alphad_ - residualAlpha_, scalar(0)))
|
||||
- exp(-a1_*max(alphad_ - residualAlpha_, scalar(0)))
|
||||
)
|
||||
/max(alphaC_, residualAlpha_);
|
||||
/max(alphac_, residualAlpha_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ public:
|
||||
general
|
||||
(
|
||||
const dictionary& dict,
|
||||
const incompressibleTwoPhaseMixture& mixture
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -39,50 +39,24 @@ namespace Foam
|
||||
Foam::relativeVelocityModel::relativeVelocityModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const incompressibleTwoPhaseMixture& mixture
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture
|
||||
)
|
||||
:
|
||||
mixture_(mixture),
|
||||
|
||||
continuousPhaseName_(dict.lookup("continuousPhase")),
|
||||
|
||||
alphaC_
|
||||
(
|
||||
mixture.phase1Name() == continuousPhaseName_
|
||||
? mixture.alpha1()
|
||||
: mixture.alpha2()
|
||||
),
|
||||
|
||||
alphaD_
|
||||
(
|
||||
mixture.phase1Name() == continuousPhaseName_
|
||||
? mixture.alpha2()
|
||||
: mixture.alpha1()
|
||||
),
|
||||
|
||||
rhoC_
|
||||
(
|
||||
mixture.phase1Name() == continuousPhaseName_
|
||||
? mixture.rho1()
|
||||
: mixture.rho2()
|
||||
),
|
||||
|
||||
rhoD_
|
||||
(
|
||||
mixture.phase1Name() == continuousPhaseName_
|
||||
? mixture.rho2()
|
||||
: mixture.rho1()
|
||||
),
|
||||
alphac_(mixture.alpha2()),
|
||||
alphad_(mixture.alpha1()),
|
||||
rhoc_(mixture.rhoc()),
|
||||
rhod_(mixture.rhod()),
|
||||
|
||||
Udm_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Udm",
|
||||
alphaC_.time().timeName(),
|
||||
alphaC_.mesh()
|
||||
alphac_.time().timeName(),
|
||||
alphac_.mesh()
|
||||
),
|
||||
alphaC_.mesh(),
|
||||
alphac_.mesh(),
|
||||
dimensionedVector("Udm", dimVelocity, vector::zero),
|
||||
mixture.U().boundaryField().types()
|
||||
)
|
||||
@ -94,7 +68,7 @@ Foam::relativeVelocityModel::relativeVelocityModel
|
||||
Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const incompressibleTwoPhaseMixture& mixture
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture
|
||||
)
|
||||
{
|
||||
word modelType(dict.lookup(typeName));
|
||||
@ -141,24 +115,24 @@ Foam::relativeVelocityModel::~relativeVelocityModel()
|
||||
|
||||
tmp<volScalarField> Foam::relativeVelocityModel::rho() const
|
||||
{
|
||||
return alphaC_*rhoC_ + alphaD_*rhoD_;
|
||||
return alphac_*rhoc_ + alphad_*rhod_;
|
||||
}
|
||||
|
||||
|
||||
tmp<volSymmTensorField> Foam::relativeVelocityModel::tauDm() const
|
||||
{
|
||||
volScalarField betaC(alphaC_*rhoC_);
|
||||
volScalarField betaD(alphaD_*rhoD_);
|
||||
volScalarField betac(alphac_*rhoc_);
|
||||
volScalarField betad(alphad_*rhod_);
|
||||
|
||||
// Calculate the relative velocity of the continuous phase w.r.t the mean
|
||||
volVectorField Ucm(betaD*Udm_/betaC);
|
||||
volVectorField Ucm(betad*Udm_/betac);
|
||||
|
||||
return tmp<volSymmTensorField>
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
"tauDm",
|
||||
betaD*sqr(Udm_) + betaC*sqr(Ucm)
|
||||
betad*sqr(Udm_) + betac*sqr(Ucm)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "dictionary.H"
|
||||
#include "incompressibleTwoPhaseMixture.H"
|
||||
#include "incompressibleTwoPhaseInteractingMixture.H"
|
||||
#include "runTimeSelectionTables.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -63,22 +63,22 @@ protected:
|
||||
// Protected data
|
||||
|
||||
//- Mixture properties
|
||||
const incompressibleTwoPhaseMixture& mixture_;
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture_;
|
||||
|
||||
//- Name of the continuous phase
|
||||
const word continuousPhaseName_;
|
||||
|
||||
//- Continuous phase fraction
|
||||
const volScalarField& alphaC_;
|
||||
const volScalarField& alphac_;
|
||||
|
||||
//- Dispersed phase fraction
|
||||
const volScalarField& alphaD_;
|
||||
const volScalarField& alphad_;
|
||||
|
||||
//- Continuous density
|
||||
const dimensionedScalar& rhoC_;
|
||||
const dimensionedScalar& rhoc_;
|
||||
|
||||
//- Dispersed density
|
||||
const dimensionedScalar& rhoD_;
|
||||
const dimensionedScalar& rhod_;
|
||||
|
||||
//- Dispersed diffusion velocity
|
||||
mutable volVectorField Udm_;
|
||||
@ -95,7 +95,8 @@ public:
|
||||
autoPtr,
|
||||
relativeVelocityModel,
|
||||
dictionary,
|
||||
(const dictionary& dict, const incompressibleTwoPhaseMixture& mixture),
|
||||
(const dictionary& dict,
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture),
|
||||
(dict, mixture)
|
||||
);
|
||||
|
||||
@ -106,7 +107,7 @@ public:
|
||||
relativeVelocityModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
const incompressibleTwoPhaseMixture& mixture
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture
|
||||
);
|
||||
|
||||
|
||||
@ -114,7 +115,7 @@ public:
|
||||
static autoPtr<relativeVelocityModel> New
|
||||
(
|
||||
const dictionary& dict,
|
||||
const incompressibleTwoPhaseMixture& mixture
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -43,13 +43,13 @@ namespace relativeVelocityModels
|
||||
Foam::relativeVelocityModels::simple::simple
|
||||
(
|
||||
const dictionary& dict,
|
||||
const incompressibleTwoPhaseMixture& mixture
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture
|
||||
)
|
||||
:
|
||||
relativeVelocityModel(dict, mixture),
|
||||
a_(dict.lookup("a")),
|
||||
V0_(dict.lookup("V0")),
|
||||
residualAlpha_(dict.lookup("residualAlpha"))
|
||||
a_("a", dimless, dict.lookup("a")),
|
||||
V0_("V0", dimVelocity, dict.lookup("V0")),
|
||||
residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha"))
|
||||
{}
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ Foam::relativeVelocityModels::simple::~simple()
|
||||
|
||||
void Foam::relativeVelocityModels::simple::correct()
|
||||
{
|
||||
Udm_ = (rhoC_/rho())*V0_*pow(scalar(10), -a_*max(alphaD_, scalar(0)));
|
||||
Udm_ = (rhoc_/rho())*V0_*pow(scalar(10), -a_*max(alphad_, scalar(0)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ public:
|
||||
simple
|
||||
(
|
||||
const dictionary& dict,
|
||||
const incompressibleTwoPhaseMixture& mixture
|
||||
const incompressibleTwoPhaseInteractingMixture& mixture
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
plastic/plastic.C
|
||||
BinghamPlastic/BinghamPlastic.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libdriftFluxTransportModels
|
||||
@ -23,37 +23,35 @@ sludge
|
||||
|
||||
"(plastic|BinghamPlastic)Coeffs"
|
||||
{
|
||||
plasticViscosityCoeff plasticViscosityCoeff [ 0 2 -1 0 0 0 0 ] 1.1595e-07;
|
||||
plasticViscosityExponent plasticViscosityExponent [ 0 0 0 0 0 0 0 ] 179.26;
|
||||
coeff 0.00023143;
|
||||
exponent 179.26;
|
||||
|
||||
yieldStressCoeff yieldStressCoeff [ 0 2 -2 0 0 0 0 ] 2.1137e-07;
|
||||
yieldStressExponent yieldStressExponent [ 0 0 0 0 0 0 0 ] 1050.8;
|
||||
yieldStressOffset yieldStressOffset [ 0 0 0 0 0 0 0 ] 0;
|
||||
BinghamCoeff 0.00042189;
|
||||
BinghamExponent 1050.8;
|
||||
BinghamOffset 0;
|
||||
|
||||
nuMin nuMin [ 0 2 -1 0 0 0 0 ] 1e-10;
|
||||
nuMax nuMax [ 0 2 -1 0 0 0 0 ] 5e-3;
|
||||
muMax 10;
|
||||
}
|
||||
|
||||
rho rho [ 1 -3 0 0 0 0 0 ] 1996;
|
||||
rho 1996;
|
||||
}
|
||||
|
||||
water
|
||||
{
|
||||
transportModel Newtonian;
|
||||
|
||||
nu nu [ 0 2 -1 0 0 0 0 ] 1.7871e-06;
|
||||
rho rho [ 1 -3 0 0 0 0 0 ] 996;
|
||||
nu 1.7871e-06;
|
||||
rho 996;
|
||||
}
|
||||
|
||||
relativeVelocityModel simple;
|
||||
|
||||
"(simple|general)Coeffs"
|
||||
{
|
||||
continuousPhase water;
|
||||
V0 V0 [ 0 1 -1 0 0 0 0 ] ( 0 -0.002198 0 );
|
||||
a a [ 0 0 0 0 0 0 0 ] 285.84;
|
||||
a1 a1 [ 0 0 0 0 0 0 0 ] 0.1;
|
||||
residualAlpha residualAlpha [ 0 0 0 0 0 0 0 ] 0;
|
||||
V0 (0 -0.002198 0);
|
||||
a 285.84;
|
||||
a1 0.1;
|
||||
residualAlpha 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -23,37 +23,35 @@ sludge
|
||||
|
||||
"(plastic|BinghamPlastic)Coeffs"
|
||||
{
|
||||
plasticViscosityCoeff plasticViscosityCoeff [ 0 2 -1 0 0 0 0 ] 1.1595e-07;
|
||||
plasticViscosityExponent plasticViscosityExponent [ 0 0 0 0 0 0 0 ] 179.26;
|
||||
coeff 0.00023143;
|
||||
exponent 179.26;
|
||||
|
||||
yieldStressCoeff yieldStressCoeff [ 0 2 -2 0 0 0 0 ] 2.1137e-07;
|
||||
yieldStressExponent yieldStressExponent [ 0 0 0 0 0 0 0 ] 1050.8;
|
||||
yieldStressOffset yieldStressOffset [ 0 0 0 0 0 0 0 ] 0;
|
||||
BinghamCoeff 0.00042189;
|
||||
BinghamExponent 1050.8;
|
||||
BinghamOffset 0;
|
||||
|
||||
nuMin nuMin [ 0 2 -1 0 0 0 0 ] 1e-10;
|
||||
nuMax nuMax [ 0 2 -1 0 0 0 0 ] 5e-3;
|
||||
muMax 10;
|
||||
}
|
||||
|
||||
rho rho [ 1 -3 0 0 0 0 0 ] 1996;
|
||||
rho 1996;
|
||||
}
|
||||
|
||||
water
|
||||
{
|
||||
transportModel Newtonian;
|
||||
|
||||
nu nu [ 0 2 -1 0 0 0 0 ] 1.7871e-06;
|
||||
rho rho [ 1 -3 0 0 0 0 0 ] 996;
|
||||
nu 1.7871e-06;
|
||||
rho 996;
|
||||
}
|
||||
|
||||
relativeVelocityModel simple;
|
||||
|
||||
"(simple|general)Coeffs"
|
||||
{
|
||||
continuousPhase water;
|
||||
V0 V0 [ 0 1 -1 0 0 0 0 ] ( 0 -0.002198 0 );
|
||||
a a [ 0 0 0 0 0 0 0 ] 285.84;
|
||||
a1 a1 [ 0 0 0 0 0 0 0 ] 0.1;
|
||||
residualAlpha residualAlpha [ 0 0 0 0 0 0 0 ] 0;
|
||||
V0 (0 -0.002198 0);
|
||||
a 285.84;
|
||||
a1 0.1;
|
||||
residualAlpha 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -23,38 +23,35 @@ sludge
|
||||
|
||||
"(plastic|BinghamPlastic)Coeffs"
|
||||
{
|
||||
plasticViscosityCoeff plasticViscosityCoeff [ 0 2 -1 0 0 0 0 ] 2.2210e-07;
|
||||
plasticViscosityExponent plasticViscosityExponent [ 0 0 0 0 0 0 0 ] 0.17926;
|
||||
coeff 0.00023143;
|
||||
exponent 0.17926;
|
||||
|
||||
yieldStressCoeff yieldStressCoeff [ 0 2 -2 0 0 0 0 ] 5.3233e-10;
|
||||
yieldStressExponent yieldStressExponent [ 0 0 0 0 0 0 0 ] 95.25;
|
||||
yieldStressOffset yieldStressOffset [ 0 0 0 0 0 0 0 ] 0;
|
||||
BinghamCoeff 5.5469e-07;
|
||||
BinghamExponent 95.25;
|
||||
BinghamOffset 0;
|
||||
|
||||
nuMin nuMin [ 0 2 -1 0 0 0 0 ] 1e-10;
|
||||
nuMax nuMax [ 0 2 -1 0 0 0 0 ] 5e-3;
|
||||
muMax 10;
|
||||
}
|
||||
|
||||
rho rho [ 1 -3 0 0 0 0 0 ] 1042;
|
||||
rho 1042;
|
||||
}
|
||||
|
||||
water
|
||||
{
|
||||
transportModel Newtonian;
|
||||
|
||||
nu nu [ 0 2 -1 0 0 0 0 ] 1.78e-06;
|
||||
rho rho [ 1 -3 0 0 0 0 0 ] 1000;
|
||||
nu 1.78e-06;
|
||||
rho 1000;
|
||||
}
|
||||
|
||||
relativeVelocityModel simple;
|
||||
|
||||
"(simple|general)Coeffs"
|
||||
{
|
||||
continuousPhase water;
|
||||
V0 V0 [ 0 1 -1 0 0 0 0 ] ( 0 -0.002198 0 );
|
||||
a a [ 0 0 0 0 0 0 0 ] 8.84;
|
||||
a1 a1 [ 0 0 0 0 0 0 0 ] 0.1;
|
||||
residualAlpha residualAlpha [ 0 0 0 0 0 0 0 ] 0;
|
||||
V0 (0 -0.002198 0);
|
||||
a 8.84;
|
||||
a1 0.1;
|
||||
residualAlpha 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user