OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

SchaefferFrictionalStress.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "SchaefferFrictionalStress.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 
00030 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034     defineTypeNameAndDebug(SchaefferFrictionalStress, 0);
00035 
00036     addToRunTimeSelectionTable
00037     (
00038         frictionalStressModel,
00039         SchaefferFrictionalStress,
00040         dictionary
00041     );
00042 }
00043 
00044 
00045 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00046 
00047 Foam::SchaefferFrictionalStress::SchaefferFrictionalStress
00048 (
00049     const dictionary& dict
00050 )
00051 :
00052     frictionalStressModel(dict)
00053 {}
00054 
00055 
00056 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00057 
00058 Foam::SchaefferFrictionalStress::~SchaefferFrictionalStress()
00059 {}
00060 
00061 
00062 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00063 
00064 Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::
00065 frictionalPressure
00066 (
00067     const volScalarField& alpha,
00068     const dimensionedScalar& alphaMinFriction,
00069     const dimensionedScalar& alphaMax,
00070     const dimensionedScalar& Fr,
00071     const dimensionedScalar& eta,
00072     const dimensionedScalar& p
00073 ) const
00074 {
00075     return
00076         dimensionedScalar("1e24", dimensionSet(1, -1, -2, 0, 0), 1e24)
00077        *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 10.0);
00078 }
00079 
00080 
00081 Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::
00082 frictionalPressurePrime
00083 (
00084     const volScalarField& alpha,
00085     const dimensionedScalar& alphaMinFriction,
00086     const dimensionedScalar& alphaMax,
00087     const dimensionedScalar& Fr,
00088     const dimensionedScalar& eta,
00089     const dimensionedScalar& p
00090 ) const
00091 {
00092     return
00093         dimensionedScalar("1e25", dimensionSet(1, -1, -2, 0, 0), 1e25)
00094        *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 9.0);
00095 }
00096 
00097 
00098 Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::muf
00099 (
00100     const volScalarField& alpha,
00101     const dimensionedScalar& alphaMax,
00102     const volScalarField& pf,
00103     const volTensorField& D,
00104     const dimensionedScalar& phi
00105 ) const
00106 {
00107     const scalar I2Dsmall = 1.0e-15;
00108 
00109     // Creating muf assuming it should be 0 on the boundary which may not be
00110     // true
00111     tmp<volScalarField> tmuf
00112     (
00113         new volScalarField
00114         (
00115             IOobject
00116             (
00117                 "muf",
00118                 alpha.mesh().time().timeName(),
00119                 alpha.mesh()
00120             ),
00121             alpha.mesh(),
00122             dimensionedScalar("muf", dimensionSet(1, -1, -1, 0, 0), 0.0)
00123         )
00124     );
00125 
00126     volScalarField& muff = tmuf();
00127 
00128     forAll (D, celli)
00129     {
00130         if (alpha[celli] > alphaMax.value()-5e-2)
00131         {
00132             muff[celli] =
00133                 0.5*pf[celli]*sin(phi.value())
00134                /(
00135                     sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy())
00136                   + sqr(D[celli].yy() - D[celli].zz())
00137                   + sqr(D[celli].zz() - D[celli].xx()))
00138                   + sqr(D[celli].xy()) + sqr(D[celli].xz())
00139                   + sqr(D[celli].yz())) + I2Dsmall
00140                 );
00141         }
00142     }
00143 
00144     return tmuf;
00145 }
00146 
00147 
00148 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd