Viscoelastic model update: linear Maxwell and upper convected Maxvell. Jovani Favero and Miguel Nobrega

This commit is contained in:
Hrvoje Jasak 2016-06-20 11:36:24 +01:00
parent 7bca916150
commit a7d5aa2e89
5 changed files with 257 additions and 29 deletions

View file

@ -6,7 +6,8 @@ viscoelasticLaws/viscoelasticLaw/newViscoelasticLaw.C
viscoelasticLaws/LPTT/LPTT.C
viscoelasticLaws/EPTT/EPTT.C
viscoelasticLaws/Oldroyd-B/Oldroyd_B.C
viscoelasticLaws/UpperConvectedMaxwell/UpperConvectedMaxwell.C
viscoelasticLaws/linearMaxwell/linearMaxwell.C
viscoelasticLaws/UCM/UCM.C
viscoelasticLaws/Giesekus/Giesekus.C
viscoelasticLaws/FENE-CR/FENE_CR.C
viscoelasticLaws/FENE-P/FENE_P.C

View file

@ -23,26 +23,21 @@ License
\*---------------------------------------------------------------------------*/
#include "UpperConvectedMaxwell.H"
#include "UCM.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(UpperConvectedMaxwell, 0);
addToRunTimeSelectionTable
(
viscoelasticLaw,
UpperConvectedMaxwell,
dictionary
);
defineTypeNameAndDebug(UCM, 0);
addToRunTimeSelectionTable(viscoelasticLaw, UCM, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::UpperConvectedMaxwell::UpperConvectedMaxwell
Foam::UCM::UCM
(
const word& name,
const volVectorField& U,
@ -64,7 +59,6 @@ Foam::UpperConvectedMaxwell::UpperConvectedMaxwell
U.mesh()
),
rho_(dict.lookup("rho")),
etaS_(dict.lookup("etaS")),
etaP_(dict.lookup("etaP")),
lambda_(dict.lookup("lambda"))
{}
@ -72,8 +66,7 @@ Foam::UpperConvectedMaxwell::UpperConvectedMaxwell
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::fvVectorMatrix>
Foam::UpperConvectedMaxwell::divTau(volVectorField& U) const
Foam::tmp<Foam::fvVectorMatrix> Foam::UCM::divTau(volVectorField& U) const
{
dimensionedScalar etaPEff = etaP_;
@ -81,16 +74,15 @@ Foam::UpperConvectedMaxwell::divTau(volVectorField& U) const
(
fvc::div(tau_/rho_, "div(tau)")
- fvc::laplacian(etaPEff/rho_, U, "laplacian(etaPEff,U)")
+ fvm::laplacian( (etaPEff + etaS_)/rho_, U, "laplacian(etaPEff+etaS,U)")
+ fvm::laplacian( (etaPEff)/rho_, U, "laplacian(etaPEff+etaS,U)")
);
}
void Foam::UpperConvectedMaxwell::correct()
void Foam::UCM::correct()
{
// Velocity gradient tensor
const tmp<volTensorField> tL = fvc::grad(U());
const volTensorField& L = tL();
volTensorField L = fvc::grad(U());
// Convected derivate term
volTensorField C = tau_ & L;

View file

@ -0,0 +1,130 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
UCM
Description
UCM non linear viscoelastic fluid model (BIRD et al., 1987).
Author
Jovani L. Favero. All rights reserved
SourceFiles
UCM.C
\*---------------------------------------------------------------------------*/
#ifndef UCM_H
#define UCM_H
#include "viscoelasticLaw.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class UCM Declaration
\*---------------------------------------------------------------------------*/
class UCM
:
public viscoelasticLaw
{
// Private data
//- Transported viscoelastic stress
volSymmTensorField tau_;
// Model constants
//- Density
dimensionedScalar rho_;
//- Zero shear rate polymer viscosity
dimensionedScalar etaP_;
//- Relaxation time
dimensionedScalar lambda_;
// Private Member Functions
//- Disallow default bitwise copy construct
UCM(const UCM&);
//- Disallow default bitwise assignment
void operator=(const UCM&);
public:
//- Runtime type information
TypeName("UCM");
// Constructors
//- Construct from components
UCM
(
const word& name,
const volVectorField& U,
const surfaceScalarField& phi,
const dictionary& dict
);
// Destructor
virtual ~UCM()
{}
// Member Functions
//- Return the viscoelastic stress tensor
virtual tmp<volSymmTensorField> tau() const
{
return tau_;
}
//- Return the coupling term for the momentum equation
virtual tmp<fvVectorMatrix> divTau(volVectorField& U) const;
//- Correct the viscoelastic stress
virtual void correct();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,105 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "linearMaxwell.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(linearMaxwell, 0);
addToRunTimeSelectionTable(viscoelasticLaw, linearMaxwell, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::linearMaxwell::linearMaxwell
(
const word& name,
const volVectorField& U,
const surfaceScalarField& phi,
const dictionary& dict
)
:
viscoelasticLaw(name, U, phi),
tau_
(
IOobject
(
"tau" + name,
U.time().timeName(),
U.mesh(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
U.mesh()
),
rho_(dict.lookup("rho")),
etaS_(dict.lookup("etaS")),
etaP_(dict.lookup("etaP")),
lambda_(dict.lookup("lambda"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::fvVectorMatrix> Foam::linearMaxwell::divTau(volVectorField& U) const
{
dimensionedScalar etaPEff = etaP_;
return
(
fvc::div(tau_/rho_, "div(tau)")
- fvc::laplacian(etaPEff/rho_, U, "laplacian(etaPEff,U)")
+ fvm::laplacian( (etaPEff + etaS_)/rho_, U, "laplacian(etaPEff+etaS,U)")
);
}
void Foam::linearMaxwell::correct()
{
// Velocity gradient tensor
volTensorField L = fvc::grad(U());
// Twice the rate of deformation tensor
volSymmTensorField twoD = twoSymm(L);
// Stress transport equation
fvSymmTensorMatrix tauEqn
(
fvm::ddt(tau_)
==
etaP_/lambda_*twoD
- fvm::Sp( 1/lambda_, tau_)
);
tauEqn.relax();
tauEqn.solve();
}
// ************************************************************************* //

View file

@ -22,21 +22,21 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
UpperConvectedMaxwell
linearMaxwell
Description
UpperConvectedMaxwell linear viscoelastic fluid model (UpperConvectedMaxwell, J.C., 1867).
Maxwell linear viscoelastic fluid model (linearMaxwell, J.C., 1867).
Author
Jovani L. Favero. All rights reserved
SourceFiles
UpperConvectedMaxwell.C
linearMaxwell.C
\*---------------------------------------------------------------------------*/
#ifndef UpperConvectedMaxwell_H
#define UpperConvectedMaxwell_H
#ifndef linearMaxwell_H
#define linearMaxwell_H
#include "viscoelasticLaw.H"
@ -46,10 +46,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class UpperConvectedMaxwell Declaration
Class linearMaxwell Declaration
\*---------------------------------------------------------------------------*/
class UpperConvectedMaxwell
class linearMaxwell
:
public viscoelasticLaw
{
@ -77,21 +77,21 @@ class UpperConvectedMaxwell
// Private Member Functions
//- Disallow default bitwise copy construct
UpperConvectedMaxwell(const UpperConvectedMaxwell&);
linearMaxwell(const linearMaxwell&);
//- Disallow default bitwise assignment
void operator=(const UpperConvectedMaxwell&);
void operator=(const linearMaxwell&);
public:
//- Runtime type information
TypeName("UpperConvectedMaxwell");
TypeName("linearMaxwell");
// Constructors
//- Construct from components
UpperConvectedMaxwell
linearMaxwell
(
const word& name,
const volVectorField& U,
@ -102,7 +102,7 @@ public:
// Destructor
virtual ~UpperConvectedMaxwell()
virtual ~linearMaxwell()
{}