Skip to content
Snippets Groups Projects
Commit 76f7fd18 authored by Henry's avatar Henry
Browse files

filmViscosityModel/ArrheniusViscosity: temperature-dependent viscosity function

Applied as a correction pre-factor to the viscosity obtained from a
run-time selectable base-model.
parent f5ce55c1
Branches
Tags
No related merge requests found
......@@ -56,6 +56,7 @@ $(THERMOMODELS)/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C
$(THERMOMODELS)/filmViscosityModel/constantViscosity/constantViscosity.C
$(THERMOMODELS)/filmViscosityModel/liquidViscosity/liquidViscosity.C
$(THERMOMODELS)/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.C
$(THERMOMODELS)/filmViscosityModel/ArrheniusViscosity/ArrheniusViscosity.C
/* Boundary conditions */
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "ArrheniusViscosity.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(ArrheniusViscosity, 0);
addToRunTimeSelectionTable
(
filmViscosityModel,
ArrheniusViscosity,
dictionary
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
ArrheniusViscosity::ArrheniusViscosity
(
surfaceFilmModel& owner,
const dictionary& dict,
volScalarField& mu
)
:
filmViscosityModel(typeName, owner, dict, mu),
viscosity_(filmViscosityModel::New(owner, coeffDict_, mu)),
k1_("k1", dimTemperature, coeffDict_.lookup("k1")),
k2_("k2", dimTemperature, coeffDict_.lookup("k2")),
Tref_("Tref", dimTemperature, coeffDict_.lookup("Tref"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
ArrheniusViscosity::~ArrheniusViscosity()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void ArrheniusViscosity::correct
(
const volScalarField& p,
const volScalarField& T
)
{
viscosity_->correct(p, T);
mu_ *= exp(k1_*((1/(T + k2_)) - 1/(Tref_ + k2_)));
mu_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace regionModels
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::ArrheniusViscosity
Description
The Arrhenius temperature-dependent viscosity model multiplies the viscosity
of a base model by an Arrhenius-type temperature function:
mu = mu0*exp(k1*(1/(T + k2) - 1/(Tref + k2)))
Where:
mu0 is the base-model viscosity
k1 and k2 are Arrhenius coefficients
T is the local temperature
Tref is the reference temperature
SourceFiles
ArrheniusViscosity.C
\*---------------------------------------------------------------------------*/
#ifndef ArrheniusViscosity_H
#define ArrheniusViscosity_H
#include "filmViscosityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class ArrheniusViscosity Declaration
\*---------------------------------------------------------------------------*/
class ArrheniusViscosity
:
public filmViscosityModel
{
// Private member functions
//- Disallow default bitwise copy construct
ArrheniusViscosity(const ArrheniusViscosity&);
//- Disallow default bitwise assignment
void operator=(const ArrheniusViscosity&);
protected:
// Protected data
//- Base viscosity model
autoPtr<filmViscosityModel> viscosity_;
//- Coefficient k1
dimensionedScalar k1_;
//- Coefficient k2
dimensionedScalar k2_;
//- Reference temperature
dimensionedScalar Tref_;
public:
//- Runtime type information
TypeName("Arrhenius");
// Constructors
//- Construct from surface film model
ArrheniusViscosity
(
surfaceFilmModel& owner,
const dictionary& dict,
volScalarField& mu
);
//- Destructor
virtual ~ArrheniusViscosity();
// Member Functions
//- Correct
virtual void correct
(
const volScalarField& p,
const volScalarField& T
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace regionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
......@@ -53,33 +53,6 @@ addToRunTimeSelectionTable
);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void thixotropicViscosity::updateMu()
{
const kinematicSingleLayer& film = filmType<kinematicSingleLayer>();
// Blend based on mass fraction of added- to existing film mass
const dimensionedScalar m0("zero", dimMass, 0.0);
const dimensionedScalar mSMALL("SMALL", dimMass, ROOTVSMALL);
const volScalarField deltaMass("deltaMass", max(m0, film.deltaMass()));
const volScalarField filmMass("filmMass", film.netMass() + mSMALL);
// Weighting field to blend new and existing mass contributions
const volScalarField w
(
"w",
max(scalar(0.0), min(scalar(1.0), deltaMass/(deltaMass + filmMass)))
);
mu_ =
w*muInf_
+ (1 - w)*muInf_/(sqr(1.0 - K_*lambda_) + ROOTVSMALL);
mu_.correctBoundaryConditions();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
thixotropicViscosity::thixotropicViscosity
......@@ -113,9 +86,7 @@ thixotropicViscosity::thixotropicViscosity
lambda_.min(1.0);
lambda_.max(0.0);
// Initialise viscosity to inf value
// - cannot call updateMu() since this calls film.netMass() which
// cannot be evaluated yet (still in construction)
// Initialise viscosity to inf value because it cannot be evaluated yet
mu_ = muInf_;
mu_.correctBoundaryConditions();
}
......@@ -177,7 +148,30 @@ void thixotropicViscosity::correct
lambda_.min(1.0);
lambda_.max(0.0);
updateMu();
// Blend based on mass fraction of added- to existing film mass
const dimensionedScalar m0("zero", dimMass, 0.0);
const dimensionedScalar mSMALL("SMALL", dimMass, ROOTVSMALL);
const volScalarField deltaMass
(
"thixotropicViscosity:deltaMass",
max(m0, film.deltaMass())
);
const volScalarField filmMass
(
"thixotropicViscosity:filmMass",
film.netMass() + mSMALL
);
// Weighting field to blend new and existing mass contributions
const volScalarField w
(
"thixotropicViscosity:w",
max(scalar(0.0), min(scalar(1.0), deltaMass/(deltaMass + filmMass)))
);
mu_ = w*muInf_ + (1 - w)*muInf_/(sqr(1.0 - K_*lambda_) + ROOTVSMALL);
mu_.correctBoundaryConditions();
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -56,7 +56,6 @@ Description
\mu_{\infty} | limiting viscosity when \f$ \lambda = 0 \f$
\endvartable
Reference:
\verbatim
Barnes H A, 1997. Thixotropy - a review. J. Non-Newtonian Fluid
......@@ -90,8 +89,6 @@ class thixotropicViscosity
:
public filmViscosityModel
{
private:
// Private member functions
//- Disallow default bitwise copy construct
......@@ -132,12 +129,6 @@ protected:
volScalarField lambda_;
// Protected Member Functions
//- Update the viscosity
void updateMu();
public:
//- Runtime type information
......@@ -161,14 +152,12 @@ public:
// Member Functions
// Evolution
//- Correct
virtual void correct
(
const volScalarField& p,
const volScalarField& T
);
//- Correct
virtual void correct
(
const volScalarField& p,
const volScalarField& T
);
};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment