Commit a3c6e30b authored by Henry Weller's avatar Henry Weller
Browse files

reactingTwoPhaseEulerFoam: Change the sign of the compressibility correction field

to correspond to the phase dilatation rate.
parent d83df30b
......@@ -338,14 +338,14 @@ while (pimple.correct())
phi2 = phi - alphaf1*phir;
}
// Compressibility correction for phase-fraction equations
// Set the phase dilatation rates
if (phase1.compressible())
{
phase1.D(pEqnComp1 & p_rgh);
phase1.divU(-pEqnComp1 & p_rgh);
}
if (phase2.compressible())
{
phase2.D(pEqnComp2 & p_rgh);
phase2.divU(-pEqnComp2 & p_rgh);
}
// Optionally relax pressure for velocity correction
......
......@@ -323,14 +323,14 @@ while (pimple.correct())
U2.correctBoundaryConditions();
fvOptions.correct(U2);
// Compressibility correction for phase-fraction equations
// Set the phase dilatation rates
if (phase1.compressible())
{
phase1.D(pEqnComp1 & p_rgh);
phase1.divU(-pEqnComp1 & p_rgh);
}
if (phase2.compressible())
{
phase2.D(pEqnComp2 & p_rgh);
phase2.divU(-pEqnComp2 & p_rgh);
}
}
}
......
......@@ -36,16 +36,16 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::AnisothermalPhaseModel
)
:
BasePhaseModel(fluid, phaseName),
D_
divU_
(
IOobject
(
IOobject::groupName("D", this->name()),
IOobject::groupName("divU", this->name()),
fluid.mesh().time().timeName(),
fluid.mesh()
),
fluid.mesh(),
dimensionedScalar("D", dimless/dimTime, 0)
dimensionedScalar("divU", dimless/dimTime, 0)
),
K_
(
......@@ -140,17 +140,17 @@ bool Foam::AnisothermalPhaseModel<BasePhaseModel>::compressible() const
template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::AnisothermalPhaseModel<BasePhaseModel>::D() const
Foam::AnisothermalPhaseModel<BasePhaseModel>::divU() const
{
return D_;
return divU_;
}
template<class BasePhaseModel>
void
Foam::AnisothermalPhaseModel<BasePhaseModel>::D(const volScalarField& D)
Foam::AnisothermalPhaseModel<BasePhaseModel>::divU(const volScalarField& divU)
{
D_ = D;
divU_ = divU;
}
......
......@@ -54,8 +54,8 @@ class AnisothermalPhaseModel
{
// Private data
//- Dilatation
volScalarField D_;
//- Dilatation rate
volScalarField divU_;
//- Kinetic energy
volScalarField K_;
......@@ -89,11 +89,11 @@ public:
//- Return true if the phase is compressible otherwise false
virtual bool compressible() const;
//- Phase dilatation rate ((alpha/rho)*Drho/Dt)
virtual tmp<volScalarField> D() const;
//- Phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual tmp<volScalarField> divU() const;
//- Set phase dilatation rate ((alpha/rho)*Drho/Dt)
virtual void D(const volScalarField& D);
//- Set phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual void divU(const volScalarField& divU);
};
......
......@@ -140,15 +140,15 @@ bool Foam::phaseModel::compressible() const
}
Foam::tmp<Foam::volScalarField> Foam::phaseModel::D() const
Foam::tmp<Foam::volScalarField> Foam::phaseModel::divU() const
{
return tmp<volScalarField>();
}
void Foam::phaseModel::D(const volScalarField& D)
void Foam::phaseModel::divU(const volScalarField& divU)
{
WarningIn("phaseModel::D(const volScalarField& D)")
WarningIn("phaseModel::divU(const volScalarField& divU)")
<< "Attempt to set the dilatation rate of an incompressible phase"
<< endl;
}
......
......@@ -169,11 +169,11 @@ public:
//- Return true if the phase is compressible otherwise false
virtual bool compressible() const;
//- Phase dilatation rate ((alpha/rho)*Drho/Dt)
virtual tmp<volScalarField> D() const;
//- Phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual tmp<volScalarField> divU() const;
//- Set phase dilatation rate ((alpha/rho)*Drho/Dt)
virtual void D(const volScalarField& D);
//- Set phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual void divU(const volScalarField& divU);
// Thermo
......
......@@ -189,26 +189,26 @@ void Foam::twoPhaseSystem::solve()
{
tdgdt =
(
alpha1.dimensionedInternalField()
*phase2_.D()().dimensionedInternalField()
- alpha2.dimensionedInternalField()
*phase1_.D()().dimensionedInternalField()
alpha2.dimensionedInternalField()
*phase1_.divU()().dimensionedInternalField()
- alpha1.dimensionedInternalField()
*phase2_.divU()().dimensionedInternalField()
);
}
else if (phase1_.compressible())
{
tdgdt =
(
- alpha2.dimensionedInternalField()
*phase1_.D()().dimensionedInternalField()
alpha2.dimensionedInternalField()
*phase1_.divU()().dimensionedInternalField()
);
}
else if (phase2_.compressible())
{
tdgdt =
(
alpha1.dimensionedInternalField()
*phase2_.D()().dimensionedInternalField()
- alpha1.dimensionedInternalField()
*phase2_.divU()().dimensionedInternalField()
);
}
......
Markdown is supported
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