Kunz.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "Kunz.H"
00028 #include "addToRunTimeSelectionTable.H"
00029
00030
00031
00032 namespace Foam
00033 {
00034 namespace phaseChangeTwoPhaseMixtures
00035 {
00036 defineTypeNameAndDebug(Kunz, 0);
00037 addToRunTimeSelectionTable(phaseChangeTwoPhaseMixture, Kunz, components);
00038 }
00039 }
00040
00041
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
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