From a3c6e30bc742fbdf0ba714e42f341042ddfcd694 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Thu, 25 Jun 2015 16:37:53 +0100 Subject: [PATCH] reactingTwoPhaseEulerFoam: Change the sign of the compressibility correction field to correspond to the phase dilatation rate. --- .../reactingTwoPhaseEulerFoam/pU/pEqn.H | 6 +++--- .../reactingTwoPhaseEulerFoam/pUf/pEqn.H | 6 +++--- .../AnisothermalPhaseModel.C | 14 +++++++------- .../AnisothermalPhaseModel.H | 12 ++++++------ .../phaseModel/phaseModel/phaseModel.C | 6 +++--- .../phaseModel/phaseModel/phaseModel.H | 8 ++++---- .../phaseSystems/twoPhaseSystem/twoPhaseSystem.C | 16 ++++++++-------- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pU/pEqn.H index 9a4174e8c1..338b0d88b6 100644 --- a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pU/pEqn.H @@ -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 diff --git a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pUf/pEqn.H index 05ed9e7d08..8736d0d5a3 100644 --- a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/pUf/pEqn.H @@ -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); } } } diff --git a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C index 99e16af8a0..01ddeb772f 100644 --- a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C +++ b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.C @@ -36,16 +36,16 @@ Foam::AnisothermalPhaseModel::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::compressible() const template Foam::tmp -Foam::AnisothermalPhaseModel::D() const +Foam::AnisothermalPhaseModel::divU() const { - return D_; + return divU_; } template void -Foam::AnisothermalPhaseModel::D(const volScalarField& D) +Foam::AnisothermalPhaseModel::divU(const volScalarField& divU) { - D_ = D; + divU_ = divU; } diff --git a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H index c69156b356..1ff8b79d8b 100644 --- a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H +++ b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/AnisothermalPhaseModel/AnisothermalPhaseModel.H @@ -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 D() const; + //- Phase dilatation rate (d(alpha)/dt + div(alpha*phi)) + virtual tmp 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); }; diff --git a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C index d1cc94e6c1..5f290080d4 100644 --- a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.C @@ -140,15 +140,15 @@ bool Foam::phaseModel::compressible() const } -Foam::tmp Foam::phaseModel::D() const +Foam::tmp Foam::phaseModel::divU() const { return tmp(); } -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; } diff --git a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H index e42a3a70b4..4fe4b9d1aa 100644 --- a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H +++ b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/phaseModel/phaseModel/phaseModel.H @@ -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 D() const; + //- Phase dilatation rate (d(alpha)/dt + div(alpha*phi)) + virtual tmp 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 diff --git a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/twoPhaseSystem/twoPhaseSystem.C index 00ebfcffb9..825089539f 100644 --- a/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/reactingTwoPhaseEulerFoam/phaseSystems/twoPhaseSystem/twoPhaseSystem.C @@ -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() ); }