Commit 2780df83 authored by Henry's avatar Henry
Browse files

multiphase: Update phase-naming to use the new convention e.g. alpha.water

parent 208f6302
{
gamma = max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));
gamma2 = 1.0 - gamma;
alphav = max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0));
alphal = 1.0 - alphav;
Info<< "max-min gamma: " << max(gamma).value()
<< " " << min(gamma).value() << endl;
Info<< "max-min alphav: " << max(alphav).value()
<< " " << min(alphav).value() << endl;
psiModel->correct();
......
......@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
while (pimple.loop())
{
#include "rhoEqn.H"
#include "gammaPsi.H"
#include "alphavPsi.H"
#include "UEqn.H"
// --- Pressure corrector loop
......
{
volScalarField thermoRho = psi*p + gamma2*rhol0;
volScalarField thermoRho = psi*p + alphal*rhol0;
dimensionedScalar totalMass = fvc::domainIntegrate(rho);
......
......@@ -44,19 +44,19 @@
Info<< "Reading transportProperties\n" << endl;
incompressibleTwoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
incompressibleTwoPhaseMixture twoPhaseProperties(U, phiv);
volScalarField& gamma(twoPhaseProperties.alpha1());
gamma.oldTime();
volScalarField& alphav(twoPhaseProperties.alpha1());
alphav.oldTime();
volScalarField& gamma2(twoPhaseProperties.alpha2());
volScalarField& alphal(twoPhaseProperties.alpha2());
Info<< "Creating compressibilityModel\n" << endl;
autoPtr<barotropicCompressibilityModel> psiModel =
barotropicCompressibilityModel::New
(
thermodynamicProperties,
gamma
alphav
);
const volScalarField& psi = psiModel->psi();
......@@ -64,8 +64,8 @@
rho == max
(
psi*p
+ gamma2*rhol0
+ ((gamma*psiv + gamma2*psil) - psi)*pSat,
+ alphal*rhol0
+ ((alphav*psiv + alphal*psil) - psi)*pSat,
rhoMin
);
......
......@@ -4,8 +4,8 @@
p =
(
rho
- gamma2*rhol0
- ((gamma*psiv + gamma2*psil) - psi)*pSat
- alphal*rhol0
- ((alphav*psiv + alphal*psil) - psi)*pSat
)/psi;
}
......@@ -29,7 +29,7 @@
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
- (rhol0 + (psil - psiv)*pSat)*fvc::ddt(gamma) - pSat*fvc::ddt(psi)
- (rhol0 + (psil - psiv)*pSat)*fvc::ddt(alphav) - pSat*fvc::ddt(psi)
+ fvc::div(phiv, rho)
+ fvc::div(phiGradp)
- fvm::laplacian(rAUf, p)
......@@ -49,18 +49,18 @@
rho == max
(
psi*p
+ gamma2*rhol0
+ ((gamma*psiv + gamma2*psil) - psi)*pSat,
+ alphal*rhol0
+ ((alphav*psiv + alphal*psil) - psi)*pSat,
rhoMin
);
#include "gammaPsi.H"
#include "alphavPsi.H"
p =
(
rho
- gamma2*rhol0
- ((gamma*psiv + gamma2*psil) - psi)*pSat
- alphal*rhol0
- ((alphav*psiv + alphal*psil) - psi)*pSat
)/psi;
p.correctBoundaryConditions();
......
......@@ -49,12 +49,12 @@ Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo
thermo2_(NULL)
{
{
volScalarField T1("T" + phase1Name(), T_);
volScalarField T1(IOobject::groupName("T", phase1Name()), T_);
T1.write();
}
{
volScalarField T2("T" + phase2Name(), T_);
volScalarField T2(IOobject::groupName("T", phase2Name()), T_);
T2.write();
}
......
......@@ -42,11 +42,10 @@ namespace phaseChangeTwoPhaseMixtures
Foam::phaseChangeTwoPhaseMixtures::Kunz::Kunz
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name
const surfaceScalarField& phi
)
:
phaseChangeTwoPhaseMixture(typeName, U, phi, alpha1Name),
phaseChangeTwoPhaseMixture(typeName, U, phi),
UInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf")),
tInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf")),
......
......@@ -91,8 +91,7 @@ public:
Kunz
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name = "alpha1"
const surfaceScalarField& phi
);
......
......@@ -42,11 +42,10 @@ namespace phaseChangeTwoPhaseMixtures
Foam::phaseChangeTwoPhaseMixtures::Merkle::Merkle
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name
const surfaceScalarField& phi
)
:
phaseChangeTwoPhaseMixture(typeName, U, phi, alpha1Name),
phaseChangeTwoPhaseMixture(typeName, U, phi),
UInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf")),
tInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf")),
......
......@@ -85,8 +85,7 @@ public:
Merkle
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name = "alpha1"
const surfaceScalarField& phi
);
......
......@@ -49,11 +49,10 @@ namespace phaseChangeTwoPhaseMixtures
Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::SchnerrSauer
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name
const surfaceScalarField& phi
)
:
phaseChangeTwoPhaseMixture(typeName, U, phi, alpha1Name),
phaseChangeTwoPhaseMixture(typeName, U, phi),
n_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("n")),
dNuc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("dNuc")),
......
......@@ -98,8 +98,7 @@ public:
SchnerrSauer
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name = "alpha1"
const surfaceScalarField& phi
);
......
......@@ -32,8 +32,7 @@ Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>
Foam::phaseChangeTwoPhaseMixture::New
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name
const surfaceScalarField& phi
)
{
IOdictionary transportPropertiesDict
......@@ -73,7 +72,7 @@ Foam::phaseChangeTwoPhaseMixture::New
<< exit(FatalError);
}
return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi, alpha1Name));
return autoPtr<phaseChangeTwoPhaseMixture>(cstrIter()(U, phi));
}
......
......@@ -39,11 +39,10 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture
(
const word& type,
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name
const surfaceScalarField& phi
)
:
incompressibleTwoPhaseMixture(U, phi, alpha1Name),
incompressibleTwoPhaseMixture(U, phi),
phaseChangeTwoPhaseMixtureCoeffs_(subDict(type + "Coeffs")),
pSat_(lookup("pSat"))
{}
......
......@@ -91,10 +91,9 @@ public:
components,
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name
const surfaceScalarField& phi
),
(U, phi, alpha1Name)
(U, phi)
);
......@@ -104,8 +103,7 @@ public:
static autoPtr<phaseChangeTwoPhaseMixture> New
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name = "alpha1"
const surfaceScalarField& phi
);
......@@ -116,8 +114,7 @@ public:
(
const word& type,
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name = "alpha1"
const surfaceScalarField& phi
);
......
{
word alphaScheme("div(phi,alpha1)");
word alphaScheme("div(phi,alpha)");
surfaceScalarField phiAlpha
(
......
......@@ -39,7 +39,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(p, iF),
flowRate_(0)
flowRate_(0),
alphaName_("none")
{}
......@@ -53,7 +54,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
flowRate_(ptf.flowRate_)
flowRate_(ptf.flowRate_),
alphaName_(ptf.alphaName_)
{}
......@@ -66,7 +68,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(p, iF, dict),
flowRate_(readScalar(dict.lookup("flowRate")))
flowRate_(readScalar(dict.lookup("flowRate"))),
alphaName_(dict.lookup("alpha"))
{}
......@@ -77,7 +80,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(ptf),
flowRate_(ptf.flowRate_)
flowRate_(ptf.flowRate_),
alphaName_(ptf.alphaName_)
{}
......@@ -89,7 +93,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(ptf, iF),
flowRate_(ptf.flowRate_)
flowRate_(ptf.flowRate_),
alphaName_(ptf.alphaName_)
{}
......@@ -104,7 +109,7 @@ void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
}
scalarField alphap =
patch().lookupPatchField<volScalarField, scalar>("alpha1");
patch().lookupPatchField<volScalarField, scalar>(alphaName_);
alphap = max(alphap, scalar(0));
alphap = min(alphap, scalar(1));
......@@ -129,6 +134,8 @@ void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::write
os.writeKeyword("flowRate") << flowRate_
<< token::END_STATEMENT << nl;
os.writeKeyword("alpha") << alphaName_
<< token::END_STATEMENT << nl;
writeEntry("value", os);
}
......
......@@ -39,6 +39,7 @@ Description
\table
Property | Description | Required | Default value
flowRate | volumetric flow rate [m3/s] | yes |
alpha | phase-fraction field | yes |
\endtable
Example of the boundary condition specification:
......@@ -47,6 +48,7 @@ Description
{
type variableHeightFlowRateInletVelocity;
flowRate 0.2;
alpha alpha.water;
value uniform (0 0 0); // placeholder
}
\endverbatim
......@@ -87,6 +89,9 @@ class variableHeightFlowRateInletVelocityFvPatchVectorField
//- Inlet integral flow rate
scalar flowRate_;
//- Name of the phase-fraction field
word alphaName_;
public:
......
......@@ -53,9 +53,7 @@ void Foam::incompressibleTwoPhaseMixture::calcNu()
Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name,
const word& alpha2Name
const surfaceScalarField& phi
)
:
IOdictionary
......@@ -69,14 +67,14 @@ Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
IOobject::NO_WRITE
)
),
twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name),
twoPhaseMixture(U.mesh(), *this),
nuModel1_
(
viscosityModel::New
(
"nu1",
subDict(phase1Name_ == "1" ? "phase1": phase1Name_),
subDict(phase1Name_),
U,
phi
)
......@@ -86,7 +84,7 @@ Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
viscosityModel::New
(
"nu2",
subDict(phase2Name_ == "2" ? "phase2": phase2Name_),
subDict(phase2Name_),
U,
phi
)
......
......@@ -86,9 +86,7 @@ public:
incompressibleTwoPhaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name = "alpha1",
const word& alpha2Name = "alpha2"
const surfaceScalarField& phi
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment