FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2011 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "SchaefferFrictionalStress.H"
00027 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00028 
00029 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033     defineTypeNameAndDebug(SchaefferFrictionalStress, 0);
00034 
00035     addToRunTimeSelectionTable
00036     (
00037         frictionalStressModel,
00038         SchaefferFrictionalStress,
00039         dictionary
00040     );
00041 }
00042 
00043 
00044 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00045 
00046 Foam::SchaefferFrictionalStress::SchaefferFrictionalStress
00047 (
00048     const dictionary& dict
00049 )
00050 :
00051     frictionalStressModel(dict)
00052 {}
00053 
00054 
00055 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00056 
00057 Foam::SchaefferFrictionalStress::~SchaefferFrictionalStress()
00058 {}
00059 
00060 
00061 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00062 
00063 Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::
00064 frictionalPressure
00065 (
00066     const volScalarField& alpha,
00067     const dimensionedScalar& alphaMinFriction,
00068     const dimensionedScalar& alphaMax,
00069     const dimensionedScalar& Fr,
00070     const dimensionedScalar& eta,
00071     const dimensionedScalar& p
00072 ) const
00073 {
00074     return
00075         dimensionedScalar("1e24", dimensionSet(1, -1, -2, 0, 0), 1e24)
00076        *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 10.0);
00077 }
00078 
00079 
00080 Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::
00081 frictionalPressurePrime
00082 (
00083     const volScalarField& alpha,
00084     const dimensionedScalar& alphaMinFriction,
00085     const dimensionedScalar& alphaMax,
00086     const dimensionedScalar& Fr,
00087     const dimensionedScalar& eta,
00088     const dimensionedScalar& p
00089 ) const
00090 {
00091     return
00092         dimensionedScalar("1e25", dimensionSet(1, -1, -2, 0, 0), 1e25)
00093        *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 9.0);
00094 }
00095 
00096 
00097 Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::muf
00098 (
00099     const volScalarField& alpha,
00100     const dimensionedScalar& alphaMax,
00101     const volScalarField& pf,
00102     const volSymmTensorField& D,
00103     const dimensionedScalar& phi
00104 ) const
00105 {
00106     const scalar I2Dsmall = 1.0e-15;
00107 
00108     // Creating muf assuming it should be 0 on the boundary which may not be
00109     // true
00110     tmp<volScalarField> tmuf
00111     (
00112         new volScalarField
00113         (
00114             IOobject
00115             (
00116                 "muf",
00117                 alpha.mesh().time().timeName(),
00118                 alpha.mesh()
00119             ),
00120             alpha.mesh(),
00121             dimensionedScalar("muf", dimensionSet(1, -1, -1, 0, 0), 0.0)
00122         )
00123     );
00124 
00125     volScalarField& muff = tmuf();
00126 
00127     forAll (D, celli)
00128     {
00129         if (alpha[celli] > alphaMax.value() - 5e-2)
00130         {
00131             muff[celli] =
00132                 0.5*pf[celli]*sin(phi.value())
00133                /(
00134                     sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy())
00135                   + sqr(D[celli].yy() - D[celli].zz())
00136                   + sqr(D[celli].zz() - D[celli].xx()))
00137                   + sqr(D[celli].xy()) + sqr(D[celli].xz())
00138                   + sqr(D[celli].yz())) + I2Dsmall
00139                 );
00140         }
00141     }
00142 
00143     muff.correctBoundaryConditions();
00144 
00145     return tmuf;
00146 }
00147 
00148 
00149 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines