reactingTwoPhaseEulerFoam: Change the sign of the compressibility correction field

to correspond to the phase dilatation rate.
This commit is contained in:
Henry Weller
2015-06-25 16:37:53 +01:00
parent d83df30b98
commit a3c6e30bc7
7 changed files with 34 additions and 34 deletions

View File

@ -338,14 +338,14 @@ while (pimple.correct())
phi2 = phi - alphaf1*phir; phi2 = phi - alphaf1*phir;
} }
// Compressibility correction for phase-fraction equations // Set the phase dilatation rates
if (phase1.compressible()) if (phase1.compressible())
{ {
phase1.D(pEqnComp1 & p_rgh); phase1.divU(-pEqnComp1 & p_rgh);
} }
if (phase2.compressible()) if (phase2.compressible())
{ {
phase2.D(pEqnComp2 & p_rgh); phase2.divU(-pEqnComp2 & p_rgh);
} }
// Optionally relax pressure for velocity correction // Optionally relax pressure for velocity correction

View File

@ -323,14 +323,14 @@ while (pimple.correct())
U2.correctBoundaryConditions(); U2.correctBoundaryConditions();
fvOptions.correct(U2); fvOptions.correct(U2);
// Compressibility correction for phase-fraction equations // Set the phase dilatation rates
if (phase1.compressible()) if (phase1.compressible())
{ {
phase1.D(pEqnComp1 & p_rgh); phase1.divU(-pEqnComp1 & p_rgh);
} }
if (phase2.compressible()) if (phase2.compressible())
{ {
phase2.D(pEqnComp2 & p_rgh); phase2.divU(-pEqnComp2 & p_rgh);
} }
} }
} }

View File

@ -36,16 +36,16 @@ Foam::AnisothermalPhaseModel<BasePhaseModel>::AnisothermalPhaseModel
) )
: :
BasePhaseModel(fluid, phaseName), BasePhaseModel(fluid, phaseName),
D_ divU_
( (
IOobject IOobject
( (
IOobject::groupName("D", this->name()), IOobject::groupName("divU", this->name()),
fluid.mesh().time().timeName(), fluid.mesh().time().timeName(),
fluid.mesh() fluid.mesh()
), ),
fluid.mesh(), fluid.mesh(),
dimensionedScalar("D", dimless/dimTime, 0) dimensionedScalar("divU", dimless/dimTime, 0)
), ),
K_ K_
( (
@ -140,17 +140,17 @@ bool Foam::AnisothermalPhaseModel<BasePhaseModel>::compressible() const
template<class BasePhaseModel> template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::AnisothermalPhaseModel<BasePhaseModel>::D() const Foam::AnisothermalPhaseModel<BasePhaseModel>::divU() const
{ {
return D_; return divU_;
} }
template<class BasePhaseModel> template<class BasePhaseModel>
void void
Foam::AnisothermalPhaseModel<BasePhaseModel>::D(const volScalarField& D) Foam::AnisothermalPhaseModel<BasePhaseModel>::divU(const volScalarField& divU)
{ {
D_ = D; divU_ = divU;
} }

View File

@ -54,8 +54,8 @@ class AnisothermalPhaseModel
{ {
// Private data // Private data
//- Dilatation //- Dilatation rate
volScalarField D_; volScalarField divU_;
//- Kinetic energy //- Kinetic energy
volScalarField K_; volScalarField K_;
@ -89,11 +89,11 @@ public:
//- Return true if the phase is compressible otherwise false //- Return true if the phase is compressible otherwise false
virtual bool compressible() const; virtual bool compressible() const;
//- Phase dilatation rate ((alpha/rho)*Drho/Dt) //- Phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual tmp<volScalarField> D() const; virtual tmp<volScalarField> divU() const;
//- Set phase dilatation rate ((alpha/rho)*Drho/Dt) //- Set phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual void D(const volScalarField& D); virtual void divU(const volScalarField& divU);
}; };

View File

@ -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>(); 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" << "Attempt to set the dilatation rate of an incompressible phase"
<< endl; << endl;
} }

View File

@ -169,11 +169,11 @@ public:
//- Return true if the phase is compressible otherwise false //- Return true if the phase is compressible otherwise false
virtual bool compressible() const; virtual bool compressible() const;
//- Phase dilatation rate ((alpha/rho)*Drho/Dt) //- Phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual tmp<volScalarField> D() const; virtual tmp<volScalarField> divU() const;
//- Set phase dilatation rate ((alpha/rho)*Drho/Dt) //- Set phase dilatation rate (d(alpha)/dt + div(alpha*phi))
virtual void D(const volScalarField& D); virtual void divU(const volScalarField& divU);
// Thermo // Thermo

View File

@ -189,26 +189,26 @@ void Foam::twoPhaseSystem::solve()
{ {
tdgdt = tdgdt =
( (
alpha1.dimensionedInternalField() alpha2.dimensionedInternalField()
*phase2_.D()().dimensionedInternalField() *phase1_.divU()().dimensionedInternalField()
- alpha2.dimensionedInternalField() - alpha1.dimensionedInternalField()
*phase1_.D()().dimensionedInternalField() *phase2_.divU()().dimensionedInternalField()
); );
} }
else if (phase1_.compressible()) else if (phase1_.compressible())
{ {
tdgdt = tdgdt =
( (
- alpha2.dimensionedInternalField() alpha2.dimensionedInternalField()
*phase1_.D()().dimensionedInternalField() *phase1_.divU()().dimensionedInternalField()
); );
} }
else if (phase2_.compressible()) else if (phase2_.compressible())
{ {
tdgdt = tdgdt =
( (
alpha1.dimensionedInternalField() - alpha1.dimensionedInternalField()
*phase2_.D()().dimensionedInternalField() *phase2_.divU()().dimensionedInternalField()
); );
} }