Commit 6edac8f9 authored by Henry Weller's avatar Henry Weller
Browse files

reactingTwoPhaseEulerFoam: Corrected kineticTheory frictional stress at walls

Patch contributed by Juho Peltola, VTT

The new JohnsonJacksonSchaefferFrictionalStress model is included and
the LBend tutorial case to demonstrate the need for the changes to the
frictional stress models.

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2058
parent f33b40c2
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,8 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "ThermalPhaseChangePhaseSystem.H"
#include "fvCFD.H"
#include "alphatPhaseChangeWallFunctionFvPatchScalarField.H"
#include "fvcVolumeIntegrate.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......
......@@ -31,6 +31,7 @@ kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStress
kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C
kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C
kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C
kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C
kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C
kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C
......
......@@ -190,6 +190,14 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
)
);
const scalarField nuFric
(
patch().lookupPatchField<volScalarField, scalar>
(
IOobject::groupName("nuFric", phased.name())
)
);
word ThetaName(IOobject::groupName("Theta", phased.name()));
const fvPatchScalarField& Theta
......@@ -222,7 +230,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
*gs0
*specularityCoefficient_.value()
*sqrt(3.0*Theta)
/max(6.0*nu*alphaMax.value(), SMALL)
/max(6.0*(nu - nuFric)*alphaMax.value(), SMALL)
);
this->valueFraction() = c/(c + patch().deltaCoeffs());
......
......@@ -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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -81,15 +81,16 @@ Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::
frictionalPressure
(
const volScalarField& alpha1,
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax
) const
{
const volScalarField& alpha = phase;
return
Fr_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_)
/pow(max(alphaMax - alpha1, alphaDeltaMin_), p_);
Fr_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_)
/pow(max(alphaMax - alpha, alphaDeltaMin_), p_);
}
......@@ -97,24 +98,26 @@ Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::
frictionalPressurePrime
(
const volScalarField& alpha1,
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax
) const
{
const volScalarField& alpha = phase;
return Fr_*
(
eta_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_ - 1.0)
*(alphaMax-alpha1)
+ p_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_)
)/pow(max(alphaMax - alpha1, alphaDeltaMin_), p_ + 1.0);
eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1.0)
*(alphaMax-alpha)
+ p_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_)
)/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1.0);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu
(
const volScalarField& alpha1,
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
......
......@@ -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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -93,21 +93,21 @@ public:
virtual tmp<volScalarField> frictionalPressure
(
const volScalarField& alpha1,
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax
) const;
virtual tmp<volScalarField> frictionalPressurePrime
(
const volScalarField& alpha1,
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax
) const;
virtual tmp<volScalarField> nu
(
const volScalarField& alpha1,
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 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 "JohnsonJacksonSchaefferFrictionalStress.H"
#include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace frictionalStressModels
{
defineTypeNameAndDebug(JohnsonJacksonSchaeffer, 0);
addToRunTimeSelectionTable
(
frictionalStressModel,
JohnsonJacksonSchaeffer,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::frictionalStressModels::
JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer
(
const dictionary& dict
)
:
frictionalStressModel(dict),
coeffDict_(dict.subDict(typeName + "Coeffs")),
Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_),
eta_("eta", dimless, coeffDict_),
p_("p", dimless, coeffDict_),
phi_("phi", dimless, coeffDict_),
alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_)
{
phi_ *= constant::mathematical::pi/180.0;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::kineticTheoryModels::frictionalStressModels::
JohnsonJacksonSchaeffer::~JohnsonJacksonSchaeffer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::
JohnsonJacksonSchaeffer::frictionalPressure
(
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax
) const
{
const volScalarField& alpha = phase;
return
Fr_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_)
/pow(max(alphaMax - alpha, alphaDeltaMin_), p_);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::
JohnsonJacksonSchaeffer::frictionalPressurePrime
(
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax
) const
{
const volScalarField& alpha = phase;
return Fr_*
(
eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1.0)
*(alphaMax-alpha)
+ p_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_)
)/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1.0);
}
Foam::tmp<Foam::volScalarField>
Foam::kineticTheoryModels::frictionalStressModels::
JohnsonJacksonSchaeffer::nu
(
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D
) const
{
const volScalarField& alpha = phase;
const scalar I2Dsmall = 1.0e-15;
tmp<volScalarField> tnu
(
new volScalarField
(
IOobject
(
"JohnsonJacksonSchaeffer:nu",
phase.mesh().time().timeName(),
phase.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
phase.mesh(),
dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0.0)
)
);
volScalarField& nuf = tnu.ref();
forAll(D, celli)
{
if (alpha[celli] > alphaMinFriction.value())
{
nuf[celli] =
0.5*pf[celli]*sin(phi_.value())
/(
sqrt
(
1.0/6.0
*(
sqr(D[celli].xx() - D[celli].yy())
+ sqr(D[celli].yy() - D[celli].zz())
+ sqr(D[celli].zz() - D[celli].xx())
)
+ sqr(D[celli].xy()) + sqr(D[celli].xz()
)
+ sqr(D[celli].yz())) + I2Dsmall
);
}
}
const fvPatchList& patches = phase.mesh().boundary();
const volVectorField& U = phase.U();
forAll(patches, patchi)
{
if (!patches[patchi].coupled())
{
nuf.boundaryField()[patchi] =
(
pf.boundaryField()[patchi]*sin(phi_.value())
/(
mag(U.boundaryField()[patchi].snGrad())
+ I2Dsmall
)
);
}
}
// Correct coupled BCs
nuf.correctBoundaryConditions();
return tnu;
}
bool Foam::kineticTheoryModels::frictionalStressModels::
JohnsonJacksonSchaeffer::read()
{
coeffDict_ <<= dict_.subDict(typeName + "Coeffs");
Fr_.read(coeffDict_);
eta_.read(coeffDict_);
p_.read(coeffDict_);
phi_.read(coeffDict_);
phi_ *= constant::mathematical::pi/180.0;
alphaDeltaMin_.read(coeffDict_);
return true;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 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::kineticTheoryModels::frictionalStressModels::JohnsonJacksonSchaeffer
Description
SourceFiles
JohnsonJacksonSchaefferFrictionalStress.C
\*---------------------------------------------------------------------------*/
#ifndef JohnsonJacksonSchaeffer_H
#define JohnsonJacksonSchaeffer_H
#include "frictionalStressModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace kineticTheoryModels
{
namespace frictionalStressModels
{
/*---------------------------------------------------------------------------*\
Class JohnsonJacksonSchaeffer Declaration
\*---------------------------------------------------------------------------*/
class JohnsonJacksonSchaeffer
:
public frictionalStressModel
{
// Private data
dictionary coeffDict_;
//- Material constant for frictional normal stress
dimensionedScalar Fr_;
//- Material constant for frictional normal stress
dimensionedScalar eta_;
//- Material constant for frictional normal stress
dimensionedScalar p_;
//- Angle of internal friction
dimensionedScalar phi_;
//- Lower limit for (alphaMax - alpha1)
dimensionedScalar alphaDeltaMin_;
public:
//- Runtime type information
TypeName("JohnsonJacksonSchaeffer");
// Constructors
//- Construct from components
JohnsonJacksonSchaeffer(const dictionary& dict);
//- Destructor
virtual ~JohnsonJacksonSchaeffer();
// Member functions
virtual tmp<volScalarField> frictionalPressure
(
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax
) const;
virtual tmp<volScalarField> frictionalPressurePrime
(
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax
) const;
virtual tmp<volScalarField> nu
(
const phaseModel& phase,
const dimensionedScalar& alphaMinFriction,
const dimensionedScalar& alphaMax,
const volScalarField& pf,
const volSymmTensorField& D
) const;
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace frictionalStressModels
} // End namespace kineticTheoryModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //