mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: twoPhaseEulerFoam: Added Johnson-Jackson slip and granular temperature BCs
This commit is contained in:
@ -32,4 +32,7 @@ kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStr
|
||||
kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C
|
||||
kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C
|
||||
|
||||
kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C
|
||||
kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libphaseIncompressibleTurbulenceModels
|
||||
|
||||
@ -0,0 +1,258 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "JohnsonJacksonParticleSlipFvPatchVectorField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "twoPhaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchVectorField,
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::JohnsonJacksonParticleSlipFvPatchVectorField::
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
partialSlipFvPatchVectorField(p, iF),
|
||||
specularityCoefficient_(p.size())
|
||||
{}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleSlipFvPatchVectorField::
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const JohnsonJacksonParticleSlipFvPatchVectorField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
partialSlipFvPatchVectorField(ptf, p, iF, mapper),
|
||||
specularityCoefficient_(ptf.specularityCoefficient_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleSlipFvPatchVectorField::
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
partialSlipFvPatchVectorField(p, iF),
|
||||
specularityCoefficient_
|
||||
(
|
||||
"specularityCoefficient",
|
||||
dimless,
|
||||
dict.lookup("specularityCoefficient")
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
(specularityCoefficient_.value() < 0)
|
||||
|| (specularityCoefficient_.value() > 1)
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"("
|
||||
"Foam::JohnsonJacksonParticleSlipFvPatchVectorField::"
|
||||
"JohnsonJacksonParticleSlipFvPatchVectorField"
|
||||
"const fvPatch& p,"
|
||||
"const DimensionedField<scalar, volMesh>& iF,"
|
||||
"const dictionary& dict"
|
||||
")"
|
||||
) << "The specularity coefficient has to be between 0 and 1"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (dict.found("value"))
|
||||
{
|
||||
fvPatchVectorField::operator=
|
||||
(
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
partialSlipFvPatchVectorField::evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleSlipFvPatchVectorField::
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const JohnsonJacksonParticleSlipFvPatchVectorField& ptf
|
||||
)
|
||||
:
|
||||
partialSlipFvPatchVectorField(ptf),
|
||||
specularityCoefficient_(ptf.specularityCoefficient_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleSlipFvPatchVectorField::
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const JohnsonJacksonParticleSlipFvPatchVectorField& ptf,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
partialSlipFvPatchVectorField(ptf, iF),
|
||||
specularityCoefficient_(ptf.specularityCoefficient_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::autoMap
|
||||
(
|
||||
const fvPatchFieldMapper& m
|
||||
)
|
||||
{
|
||||
partialSlipFvPatchVectorField::autoMap(m);
|
||||
}
|
||||
|
||||
|
||||
void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::rmap
|
||||
(
|
||||
const fvPatchVectorField& ptf,
|
||||
const labelList& addr
|
||||
)
|
||||
{
|
||||
partialSlipFvPatchVectorField::rmap(ptf, addr);
|
||||
}
|
||||
|
||||
|
||||
void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// lookup the fluid model and the phase
|
||||
const twoPhaseSystem& fluid = db().lookupObject<twoPhaseSystem>
|
||||
(
|
||||
"phaseProperties"
|
||||
);
|
||||
|
||||
const phaseModel& phased
|
||||
(
|
||||
fluid.phase1().name() == dimensionedInternalField().group()
|
||||
? fluid.phase1()
|
||||
: fluid.phase2()
|
||||
);
|
||||
|
||||
// lookup all the fields on this patch
|
||||
const fvPatchScalarField& alpha
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
phased.volScalarField::name()
|
||||
)
|
||||
);
|
||||
|
||||
const fvPatchScalarField& gs0
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
IOobject::groupName("gs0", phased.name())
|
||||
)
|
||||
);
|
||||
|
||||
const scalarField nu
|
||||
(
|
||||
phased.nu()->boundaryField()[patch().index()]
|
||||
);
|
||||
|
||||
word ThetaName(IOobject::groupName("Theta", phased.name()));
|
||||
|
||||
const fvPatchScalarField& Theta
|
||||
(
|
||||
db().foundObject<volScalarField>(ThetaName)
|
||||
? patch().lookupPatchField<volScalarField, scalar>(ThetaName)
|
||||
: alpha
|
||||
);
|
||||
|
||||
// lookup the packed volume fraction
|
||||
dimensionedScalar alphaMax
|
||||
(
|
||||
"alphaMax",
|
||||
dimless,
|
||||
db()
|
||||
.lookupObject<IOdictionary>
|
||||
(
|
||||
IOobject::groupName("turbulenceProperties", phased.name())
|
||||
)
|
||||
.subDict("RAS")
|
||||
.subDict("kineticTheoryCoeffs")
|
||||
.lookup("alphaMax")
|
||||
);
|
||||
|
||||
// calculate the slip value fraction
|
||||
scalarField c
|
||||
(
|
||||
constant::mathematical::pi
|
||||
*alpha
|
||||
*gs0
|
||||
*specularityCoefficient_.value()
|
||||
*sqrt(3.0*Theta)
|
||||
/max(6.0*nu*alphaMax.value(), SMALL)
|
||||
);
|
||||
|
||||
this->valueFraction() = c/(c + patch().deltaCoeffs());
|
||||
|
||||
partialSlipFvPatchVectorField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
partialSlipFvPatchVectorField::write(os);
|
||||
os.writeKeyword("specularityCoefficient")
|
||||
<< specularityCoefficient_ << token::END_STATEMENT << nl;
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,177 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
|
||||
Description
|
||||
Partial slip boundary condition for the particulate velocity.
|
||||
|
||||
References:
|
||||
\verbatim
|
||||
"Multifluid Eulerian modeling of dense gas–solids fluidized bed
|
||||
hydrodynamics: Influence of the dissipation parameters"
|
||||
N Reuge
|
||||
Chemical Engineering Science
|
||||
Volume 63, Issue 22, Pages 5540-5551, November 2008
|
||||
\endverbatim
|
||||
|
||||
\verbatim
|
||||
"Frictional-collisional constitutive relations for granular materials,
|
||||
with application to plane shearing"
|
||||
P C Johnson and R Jackson
|
||||
Journal of Fluid Mechanics
|
||||
Volume 176, Pages 67-93, March 1987
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef JohnsonJacksonParticleSlipFvPatchVectorField_H
|
||||
#define JohnsonJacksonParticleSlipFvPatchVectorField_H
|
||||
|
||||
#include "partialSlipFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class JohnsonJacksonParticleSlipFvPatchVectorField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
:
|
||||
public partialSlipFvPatchVectorField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Specularity coefficient
|
||||
dimensionedScalar specularityCoefficient_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("JohnsonJacksonParticleSlip");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping onto a new patch
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const JohnsonJacksonParticleSlipFvPatchVectorField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const JohnsonJacksonParticleSlipFvPatchVectorField&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchVectorField> clone() const
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new JohnsonJacksonParticleSlipFvPatchVectorField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
JohnsonJacksonParticleSlipFvPatchVectorField
|
||||
(
|
||||
const JohnsonJacksonParticleSlipFvPatchVectorField&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchVectorField> clone
|
||||
(
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new JohnsonJacksonParticleSlipFvPatchVectorField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Mapping functions
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap
|
||||
(
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Reverse map the given fvPatchField onto this fvPatchField
|
||||
virtual void rmap
|
||||
(
|
||||
const fvPatchVectorField&,
|
||||
const labelList&
|
||||
);
|
||||
|
||||
//- Update the coefficients
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,320 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 "JohnsonJacksonParticleThetaFvPatchScalarField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "twoPhaseSystem.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
restitutionCoefficient_(p.size()),
|
||||
specularityCoefficient_(p.size())
|
||||
{}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const JohnsonJacksonParticleThetaFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
||||
restitutionCoefficient_(ptf.restitutionCoefficient_),
|
||||
specularityCoefficient_(ptf.specularityCoefficient_)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(p, iF),
|
||||
restitutionCoefficient_
|
||||
(
|
||||
"restitutionCoefficient",
|
||||
dimless,
|
||||
dict.lookup("restitutionCoefficient")
|
||||
),
|
||||
specularityCoefficient_
|
||||
(
|
||||
"specularityCoefficient",
|
||||
dimless,
|
||||
dict.lookup("specularityCoefficient")
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
(restitutionCoefficient_.value() < 0)
|
||||
|| (restitutionCoefficient_.value() > 1)
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::JohnsonJacksonParticleThetaFvPatchScalarField::"
|
||||
"JohnsonJacksonParticleThetaFvPatchScalarField"
|
||||
"("
|
||||
"const fvPatch& p,"
|
||||
"const DimensionedField<scalar, volMesh>& iF,"
|
||||
"const dictionary& dict"
|
||||
")"
|
||||
) << "The restitution coefficient has to be between 0 and 1"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
(specularityCoefficient_.value() < 0)
|
||||
|| (specularityCoefficient_.value() > 1)
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::JohnsonJacksonParticleThetaFvPatchScalarField::"
|
||||
"JohnsonJacksonParticleThetaFvPatchScalarField"
|
||||
"("
|
||||
"const fvPatch& p,"
|
||||
"const DimensionedField<scalar, volMesh>& iF,"
|
||||
"const dictionary& dict"
|
||||
")"
|
||||
) << "The specularity coefficient has to be between 0 and 1"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (dict.found("value"))
|
||||
{
|
||||
fvPatchScalarField::operator=
|
||||
(
|
||||
scalarField("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
evaluate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const JohnsonJacksonParticleThetaFvPatchScalarField& ptf
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(ptf),
|
||||
restitutionCoefficient_(ptf.restitutionCoefficient_),
|
||||
specularityCoefficient_(ptf.specularityCoefficient_)
|
||||
{}
|
||||
|
||||
|
||||
Foam::JohnsonJacksonParticleThetaFvPatchScalarField::
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const JohnsonJacksonParticleThetaFvPatchScalarField& ptf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
mixedFvPatchScalarField(ptf, iF),
|
||||
restitutionCoefficient_(ptf.restitutionCoefficient_),
|
||||
specularityCoefficient_(ptf.specularityCoefficient_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::autoMap
|
||||
(
|
||||
const fvPatchFieldMapper& m
|
||||
)
|
||||
{
|
||||
mixedFvPatchScalarField::autoMap(m);
|
||||
}
|
||||
|
||||
|
||||
void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::rmap
|
||||
(
|
||||
const fvPatchScalarField& ptf,
|
||||
const labelList& addr
|
||||
)
|
||||
{
|
||||
mixedFvPatchScalarField::rmap(ptf, addr);
|
||||
}
|
||||
|
||||
|
||||
void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::updateCoeffs()
|
||||
{
|
||||
if (updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// lookup the fluid model and the phase
|
||||
const twoPhaseSystem& fluid = db().lookupObject<twoPhaseSystem>
|
||||
(
|
||||
"phaseProperties"
|
||||
);
|
||||
|
||||
const phaseModel& phased
|
||||
(
|
||||
fluid.phase1().name() == dimensionedInternalField().group()
|
||||
? fluid.phase1()
|
||||
: fluid.phase2()
|
||||
);
|
||||
|
||||
// lookup all the fields on this patch
|
||||
const fvPatchScalarField& alpha
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
phased.volScalarField::name()
|
||||
)
|
||||
);
|
||||
|
||||
const fvPatchVectorField& U
|
||||
(
|
||||
patch().lookupPatchField<volVectorField, vector>
|
||||
(
|
||||
IOobject::groupName("U", phased.name())
|
||||
)
|
||||
);
|
||||
|
||||
const fvPatchScalarField& gs0
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
IOobject::groupName("gs0", phased.name())
|
||||
)
|
||||
);
|
||||
|
||||
const fvPatchScalarField& kappa
|
||||
(
|
||||
patch().lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
IOobject::groupName("kappa", phased.name())
|
||||
)
|
||||
);
|
||||
|
||||
const scalarField Theta(patchInternalField());
|
||||
|
||||
// lookup the packed volume fraction
|
||||
dimensionedScalar alphaMax
|
||||
(
|
||||
"alphaMax",
|
||||
dimless,
|
||||
db()
|
||||
.lookupObject<IOdictionary>
|
||||
(
|
||||
IOobject::groupName("turbulenceProperties", phased.name())
|
||||
)
|
||||
.subDict("RAS")
|
||||
.subDict("kineticTheoryCoeffs")
|
||||
.lookup("alphaMax")
|
||||
);
|
||||
|
||||
// calculate the reference value and the value fraction
|
||||
if (restitutionCoefficient_.value() != 1.0)
|
||||
{
|
||||
this->refValue() =
|
||||
(2.0/3.0)
|
||||
*specularityCoefficient_.value()
|
||||
*magSqr(U)
|
||||
/(scalar(1) - sqr(restitutionCoefficient_.value()));
|
||||
|
||||
this->refGrad() = 0.0;
|
||||
|
||||
scalarField c
|
||||
(
|
||||
constant::mathematical::pi
|
||||
*alpha
|
||||
*gs0
|
||||
*(scalar(1) - sqr(restitutionCoefficient_.value()))
|
||||
*sqrt(3.0*Theta)
|
||||
/max(4.0*kappa*alphaMax.value(), SMALL)
|
||||
);
|
||||
|
||||
this->valueFraction() = c/(c + patch().deltaCoeffs());
|
||||
}
|
||||
|
||||
// for a restitution coefficient of 1, the boundary degenerates to a fixed
|
||||
// gradient condition
|
||||
else
|
||||
{
|
||||
this->refValue() = 0.0;
|
||||
|
||||
this->refGrad() =
|
||||
pos(alpha - SMALL)
|
||||
*constant::mathematical::pi
|
||||
*specularityCoefficient_.value()
|
||||
*alpha
|
||||
*gs0
|
||||
*sqrt(3.0*Theta)
|
||||
*magSqr(U)
|
||||
/max(6.0*kappa*alphaMax.value(), SMALL);
|
||||
|
||||
this->valueFraction() = 0.0;
|
||||
}
|
||||
|
||||
mixedFvPatchScalarField::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::JohnsonJacksonParticleThetaFvPatchScalarField::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
// ...
|
||||
|
||||
mixedFvPatchScalarField::write(os);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,179 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
|
||||
Description
|
||||
Robin condition for the particulate granular temperature.
|
||||
|
||||
References:
|
||||
\verbatim
|
||||
"Multifluid Eulerian modeling of dense gas–solids fluidized bed
|
||||
hydrodynamics: Influence of the dissipation parameters"
|
||||
N Reuge
|
||||
Chemical Engineering Science
|
||||
Volume 63, Issue 22, Pages 5540-5551, November 2008
|
||||
\endverbatim
|
||||
|
||||
\verbatim
|
||||
"Frictional-collisional constitutive relations for granular materials,
|
||||
with application to plane shearing"
|
||||
P C Johnson and R Jackson
|
||||
Journal of Fluid Mechanics
|
||||
Volume 176, Pages 67-93, March 1987
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef JohnsonJacksonParticleThetaFvPatchScalarField_H
|
||||
#define JohnsonJacksonParticleThetaFvPatchScalarField_H
|
||||
|
||||
#include "mixedFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class JohnsonJacksonParticleThetaFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
:
|
||||
public mixedFvPatchScalarField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Particle-wall restitution coefficient
|
||||
dimensionedScalar restitutionCoefficient_;
|
||||
|
||||
//- Specularity coefficient
|
||||
dimensionedScalar specularityCoefficient_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("JohnsonJacksonParticleTheta");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping onto a new patch
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const JohnsonJacksonParticleThetaFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const JohnsonJacksonParticleThetaFvPatchScalarField&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchScalarField> clone() const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new JohnsonJacksonParticleThetaFvPatchScalarField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
JohnsonJacksonParticleThetaFvPatchScalarField
|
||||
(
|
||||
const JohnsonJacksonParticleThetaFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchScalarField> clone
|
||||
(
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchScalarField>
|
||||
(
|
||||
new JohnsonJacksonParticleThetaFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Mapping functions
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
virtual void autoMap
|
||||
(
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Reverse map the given fvPatchField onto this fvPatchField
|
||||
virtual void rmap
|
||||
(
|
||||
const fvPatchScalarField&,
|
||||
const labelList&
|
||||
);
|
||||
|
||||
//- Update the coefficients
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user