Curious macro class: model name contains CPP. Renamed and moved

This commit is contained in:
Hrvoje Jasak 2010-10-12 13:08:40 +01:00
parent 98647fcdb3
commit 240d75c44c
3 changed files with 292 additions and 1 deletions

View file

@ -18,7 +18,7 @@ viscoelasticLaws/Leonov/Leonov.C
viscoelasticLaws/WhiteMetzner/WhiteMetznerLarson/WhiteMetznerLarson.C
viscoelasticLaws/WhiteMetzner/WhiteMetznerCross/WhiteMetznerCross.C
viscoelasticLaws/WhiteMetzner/WhiteMetznerCarreauYasuda/WhiteMetznerCarreauYasuda.C
viscoelasticLaws/S-MDCPP/S-MDCPP.C
viscoelasticLaws/S_MDCPP/S_MDCPP.C
viscoelasticLaws/multiMode/multiMode.C

View file

@ -0,0 +1,144 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "S_MDCPP.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(S_MDCPP, 0);
addToRunTimeSelectionTable(viscoelasticLaw, S_MDCPP, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::S_MDCPP::S_MDCPP
(
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()
),
I_
(
dimensionedSymmTensor
(
"I",
dimensionSet(0, 0, 0, 0, 0, 0, 0),
symmTensor
(
1, 0, 0,
1, 0,
1
)
)
),
rho_(dict.lookup("rho")),
etaS_(dict.lookup("etaS")),
etaP_(dict.lookup("etaP")),
zeta_(dict.lookup("zeta")),
lambdaOb_(dict.lookup("lambdaOb")),
lambdaOs_(dict.lookup("lambdaOs")),
q_(dict.lookup("q"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::fvVectorMatrix> Foam::S_MDCPP::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::S_MDCPP::correct()
{
// Velocity gradient tensor
volTensorField L = fvc::grad(U());
// Convected derivate term
volTensorField C = tau_ & L;
// Twice the rate of deformation tensor
volSymmTensorField twoD = twoSymm(L);
// Lambda (Backbone stretch)
volScalarField Lambda =
Foam::sqrt(1 + tr(tau_)*lambdaOb_*(1 - zeta_)/3/etaP_);
// Auxiliary field
volScalarField aux = Foam::exp( 2/q_*(Lambda - 1));
// Extra function
volScalarField fTau =
aux*(2*lambdaOb_/lambdaOs_*(1 - 1/Lambda) + 1/Foam::sqr(Lambda));
// Stress transport equation
fvSymmTensorMatrix tauEqn
(
fvm::ddt(tau_)
+ fvm::div(phi(), tau_)
==
etaP_/lambdaOb_*twoD
+ twoSymm(C)
- zeta_/2*((tau_ & twoD) + (twoD & tau_))
- fvm::Sp(1/lambdaOb_*fTau, tau_)
- (
1/lambdaOb_*(etaP_/lambdaOb_/(1 - zeta_)*(fTau - aux)*I_)
)
);
tauEqn.relax();
tauEqn.solve();
}
// ************************************************************************* //

View file

@ -0,0 +1,147 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
S-MDCPP
Description
S-MDCPP non linear viscoelastic fluid model:
Wei Wang, Xikui Li and Xianhong Han,
Journal of Non-Newtonian Fluid Mechanics, 165,1480-1493, 2010.
Author
Jovani L. Favero. All rights reserved
SourceFiles
S_MDCPP.C
\*---------------------------------------------------------------------------*/
#ifndef S_MDCP_H
#define S_MDCP_H
#include "viscoelasticLaw.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class S_MDCPP Declaration
\*---------------------------------------------------------------------------*/
class S_MDCPP
:
public viscoelasticLaw
{
// Private data
//- Transported viscoelastic stress
volSymmTensorField tau_;
//- Identity tensor
dimensionedSymmTensor I_;
// Model constants
//- Density
dimensionedScalar rho_;
//- Solvent viscosity
dimensionedScalar etaS_;
//- Zero shear rate polymer viscosity
dimensionedScalar etaP_;
//- Material parameter, defining the amount of anisotropy
dimensionedScalar zeta_;
//- Relaxation time of the backbone tube orientation
dimensionedScalar lambdaOb_;
//- Relaxation time for the stretch
dimensionedScalar lambdaOs_;
//- Amount of arms at the end of a backbone
dimensionedScalar q_;
// Private Member Functions
//- Disallow default bitwise copy construct
S_MDCPP(const S_MDCPP&);
//- Disallow default bitwise assignment
void operator=(const S_MDCPP&);
public:
//- Runtime type information
TypeName("S_MDCPP");
// Constructors
//- Construct from components
S_MDCPP
(
const word& name,
const volVectorField& U,
const surfaceScalarField& phi,
const dictionary& dict
);
// Destructor
virtual ~S_MDCPP()
{}
// 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
// ************************************************************************* //