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