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

Kunz.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 "Kunz.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 
00030 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034 namespace phaseChangeTwoPhaseMixtures
00035 {
00036     defineTypeNameAndDebug(Kunz, 0);
00037     addToRunTimeSelectionTable(phaseChangeTwoPhaseMixture, Kunz, components);
00038 }
00039 }
00040 
00041 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00042 
00043 Foam::phaseChangeTwoPhaseMixtures::Kunz::Kunz
00044 (
00045     const volVectorField& U,
00046     const surfaceScalarField& phi,
00047     const word& alpha1Name
00048 )
00049 :
00050     phaseChangeTwoPhaseMixture(typeName, U, phi, alpha1Name),
00051 
00052     UInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf")),
00053     tInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf")),
00054     Cc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc")),
00055     Cv_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv")),
00056 
00057     p0_("0", pSat().dimensions(), 0.0),
00058 
00059     mcCoeff_(Cc_*rho2()/tInf_),
00060     mvCoeff_(Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_))
00061 {
00062     correct();
00063 }
00064 
00065 
00066 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
00067 
00068 Foam::Pair<Foam::tmp<Foam::volScalarField> >
00069 Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotAlphal() const
00070 {
00071     const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
00072     volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1));
00073 
00074     return Pair<tmp<volScalarField> >
00075     (
00076         mcCoeff_*sqr(limitedAlpha1)
00077        *max(p - pSat(), p0_)/max(p - pSat(), 0.01*pSat()),
00078 
00079         mvCoeff_*min(p - pSat(), p0_)
00080     );
00081 }
00082 
00083 Foam::Pair<Foam::tmp<Foam::volScalarField> >
00084 Foam::phaseChangeTwoPhaseMixtures::Kunz::mDotP() const
00085 {
00086     const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
00087     volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1));
00088 
00089     return Pair<tmp<volScalarField> >
00090     (
00091         mcCoeff_*sqr(limitedAlpha1)*(1.0 - limitedAlpha1)
00092        *pos(p - pSat())/max(p - pSat(), 0.01*pSat()),
00093 
00094         (-mvCoeff_)*limitedAlpha1*neg(p - pSat())
00095     );
00096 }
00097 
00098 
00099 void Foam::phaseChangeTwoPhaseMixtures::Kunz::correct()
00100 {}
00101 
00102 
00103 bool Foam::phaseChangeTwoPhaseMixtures::Kunz::read()
00104 {
00105     if (phaseChangeTwoPhaseMixture::read())
00106     {
00107         phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs");
00108 
00109         phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_;
00110         phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_;
00111         phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc") >> Cc_;
00112         phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv") >> Cv_;
00113 
00114         mcCoeff_ = Cc_*rho2()/tInf_;
00115         mvCoeff_ = Cv_*rho2()/(0.5*rho1()*sqr(UInf_)*tInf_);
00116 
00117         return true;
00118     }
00119     else
00120     {
00121         return false;
00122     }
00123 }
00124 
00125 
00126 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd