twoPhaseMixture: Add alpha2

This commit is contained in:
Henry
2013-02-06 10:52:49 +00:00
parent edbf12c163
commit 59f9f9ebd1
15 changed files with 57 additions and 23 deletions

View File

@ -4,8 +4,8 @@
p = p =
( (
rho rho
- (1.0 - gamma)*rhol0 - gamma2*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat - ((gamma*psiv + gamma2*psil) - psi)*pSat
)/psi; )/psi;
} }
@ -57,8 +57,8 @@
p = p =
( (
rho rho
- (1.0 - gamma)*rhol0 - gamma2*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat - ((gamma*psiv + gamma2*psil) - psi)*pSat
)/psi; )/psi;
p.correctBoundaryConditions(); p.correctBoundaryConditions();

View File

@ -1,5 +1,5 @@
{ {
volScalarField thermoRho = psi*p + (1.0 - gamma)*rhol0; volScalarField thermoRho = psi*p + gamma2*rhol0;
dimensionedScalar totalMass = fvc::domainIntegrate(rho); dimensionedScalar totalMass = fvc::domainIntegrate(rho);

View File

@ -49,6 +49,8 @@
volScalarField& gamma(twoPhaseProperties.alpha1()); volScalarField& gamma(twoPhaseProperties.alpha1());
gamma.oldTime(); gamma.oldTime();
volScalarField& gamma2(twoPhaseProperties.alpha2());
Info<< "Creating compressibilityModel\n" << endl; Info<< "Creating compressibilityModel\n" << endl;
autoPtr<barotropicCompressibilityModel> psiModel = autoPtr<barotropicCompressibilityModel> psiModel =
barotropicCompressibilityModel::New barotropicCompressibilityModel::New
@ -62,8 +64,8 @@
rho == max rho == max
( (
psi*p psi*p
+ (1.0 - gamma)*rhol0 + gamma2*rhol0
+ ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat, + ((gamma*psiv + gamma2*psil) - psi)*pSat,
rhoMin rhoMin
); );

View File

@ -1,5 +1,6 @@
{ {
gamma = max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0)); gamma = max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));
gamma2 = 1.0 - gamma;
Info<< "max-min gamma: " << max(gamma).value() Info<< "max-min gamma: " << max(gamma).value()
<< " " << min(gamma).value() << endl; << " " << min(gamma).value() << endl;

View File

@ -4,8 +4,8 @@
p = p =
( (
rho rho
- (1.0 - gamma)*rhol0 - gamma2*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat - ((gamma*psiv + gamma2*psil) - psi)*pSat
)/psi; )/psi;
} }
@ -49,8 +49,8 @@
rho == max rho == max
( (
psi*p psi*p
+ (1.0 - gamma)*rhol0 + gamma2*rhol0
+ ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat, + ((gamma*psiv + gamma2*psil) - psi)*pSat,
rhoMin rhoMin
); );
@ -59,8 +59,8 @@
p = p =
( (
rho rho
- (1.0 - gamma)*rhol0 - gamma2*rhol0
- ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat - ((gamma*psiv + gamma2*psil) - psi)*pSat
)/psi; )/psi;
p.correctBoundaryConditions(); p.correctBoundaryConditions();

View File

@ -18,7 +18,7 @@
) )
+ fvc::flux + fvc::flux
( (
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), -fvc::flux(-phir, alpha2, alpharScheme),
alpha1, alpha1,
alpharScheme alpharScheme
) )
@ -27,6 +27,7 @@
MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0); MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0);
//MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); //MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
alpha2 = 1.0 - alpha1;
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
} }

View File

@ -23,4 +23,4 @@ else
#include "alphaEqn.H" #include "alphaEqn.H"
} }
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; rho == alpha1*rho1 + alpha2*rho2;

View File

@ -18,7 +18,7 @@
) )
+ fvc::flux + fvc::flux
( (
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme), -fvc::flux(-phir, alpha2, alpharScheme),
alpha1, alpha1,
alpharScheme alpharScheme
) )
@ -26,6 +26,7 @@
MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
alpha2 = 1.0 - alpha1;
rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2;
} }

View File

@ -23,4 +23,4 @@ else
#include "alphaEqn.H" #include "alphaEqn.H"
} }
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; rho == alpha1*rho1 + alpha2*rho2;

View File

@ -33,6 +33,7 @@
twoPhaseMixture twoPhaseProperties(U, phi); twoPhaseMixture twoPhaseProperties(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1()); volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());
const dimensionedScalar& rho1 = twoPhaseProperties.rho1(); const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
const dimensionedScalar& rho2 = twoPhaseProperties.rho2(); const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
@ -48,7 +49,7 @@
mesh, mesh,
IOobject::READ_IF_PRESENT IOobject::READ_IF_PRESENT
), ),
alpha1*rho1 + (scalar(1) - alpha1)*rho2, alpha1*rho1 + alpha2*rho2,
alpha1.boundaryField().types() alpha1.boundaryField().types()
); );
rho.oldTime(); rho.oldTime();

View File

@ -12,7 +12,8 @@
alpha1Eqn.solve(); alpha1Eqn.solve();
alpha2 = 1.0 - alpha1;
rhoPhi += alpha1Eqn.flux()*(rho1 - rho2); rhoPhi += alpha1Eqn.flux()*(rho1 - rho2);
} }
rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2; rho = alpha1*rho1 + alpha2*rho2;

View File

@ -23,4 +23,4 @@ else
#include "alphaEqn.H" #include "alphaEqn.H"
} }
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; rho == alpha1*rho1 + alpha2*rho2;

View File

@ -32,6 +32,7 @@
twoPhaseMixture twoPhaseProperties(U, phi); twoPhaseMixture twoPhaseProperties(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1()); volScalarField& alpha1(twoPhaseProperties.alpha1());
volScalarField& alpha2(twoPhaseProperties.alpha2());
const dimensionedScalar& rho1 = twoPhaseProperties.rho1(); const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
const dimensionedScalar& rho2 = twoPhaseProperties.rho2(); const dimensionedScalar& rho2 = twoPhaseProperties.rho2();
@ -42,7 +43,7 @@
dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab")); dimensionedScalar alphatab(twoPhaseProperties.lookup("alphatab"));
// Need to store rho for ddt(rho, U) // Need to store rho for ddt(rho, U)
volScalarField rho("rho", alpha1*rho1 + (scalar(1) - alpha1)*rho2); volScalarField rho("rho", alpha1*rho1 + alpha2*rho2);
rho.oldTime(); rho.oldTime();

View File

@ -54,7 +54,8 @@ Foam::twoPhaseMixture::twoPhaseMixture
( (
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& phi, const surfaceScalarField& phi,
const word& alpha1Name const word& alpha1Name,
const word& alpha2Name
) )
: :
transportModel(U, phi), transportModel(U, phi),
@ -102,6 +103,17 @@ Foam::twoPhaseMixture::twoPhaseMixture
U_.mesh() U_.mesh()
), ),
alpha2_
(
IOobject
(
found("phases") ? word("alpha" + phase2Name_) : alpha2Name,
U_.time().timeName(),
U_.db()
),
1.0 - alpha1_
),
nu_ nu_
( (
IOobject IOobject

View File

@ -70,6 +70,7 @@ protected:
const surfaceScalarField& phi_; const surfaceScalarField& phi_;
volScalarField alpha1_; volScalarField alpha1_;
volScalarField alpha2_;
volScalarField nu_; volScalarField nu_;
@ -89,7 +90,8 @@ public:
( (
const volVectorField& U, const volVectorField& U,
const surfaceScalarField& phi, const surfaceScalarField& phi,
const word& alpha1Name = "alpha1" const word& alpha1Name = "alpha1",
const word& alpha2Name = "alpha2"
); );
@ -122,6 +124,18 @@ public:
return alpha1_; return alpha1_;
} }
//- Return the phase-fraction of phase 2
const volScalarField& alpha2() const
{
return alpha2_;
}
//- Return the phase-fraction of phase 2
volScalarField& alpha2()
{
return alpha2_;
}
//- Return const-access to phase1 viscosityModel //- Return const-access to phase1 viscosityModel
const viscosityModel& nuModel1() const const viscosityModel& nuModel1() const
{ {