solvers::multiphaseEuler: New cell momentum/pressure algorithm

The cell-base momentum/pressure algorithm in the multiphaseEuler solver module
has been substantially updated to improve consistency, conservation and reduce
drag generated staggering patterns at sharp interfaces and the boundaries with
stationary phases.  For most if not all cases this new algorithm can be used to
provide well resolved and reliable solutions where the faceMomentum algorithm
would have been chosen previously in order to obtain sufficiently smooth
solutions but at the expense of a noticeable loss in accuracy and resolution.

The first significant change in the momentum/pressure algorithm is in the
interpolation practice used to construct the flux predictor equation from the
cell momentum equation: rather than interpolating the H/A ratio to the faces
i.e. (H/A)_f the terms in the momentum equation are interpolated separately so
that H_f/A_f is used.  The same approach is used for the drag i.e. (D_f/A_f) and
virtual mass contributions.  The advantage of this change is that the phase
forces are now consistent in both the momentum and flux equations, i.e. sum to
zero for each pair of phases.

The second significant change is in the handling of ddtCorr which converts the
old-time time-derivative contributions in H from velocity to flux which is now
consistent due to the change to H/A interpolation and also generalised to use
the fvc::ddtCorr function which has been updated for multiphase.  Additionally
ddtCorr may optionally be applied to the time-derivative in the virtual mass
term in a consistent manner so that the contributions to the flux equation sum
to zero for each pair of phases.

The third significant change is the addition of an optional drag correction term
to the momentum corrector to reduce the staggering patters generated in the
velocity field due to sudden changes in drag force between phase, e.g. at sharp
interfaces between phases or at the boundaries with stationary phases.  This is
particularly beneficial for fluidised bed simulations.  However this correction
is not and cannot be phase consistent, i.e. the correction does not sum to zero
for pairs of phases it is applied to so a small drag error is introduced, but
tests so far have shown that the error is small and outweighed by the benefit in
the reduction in numerical artefacts in the solution.

The final significant change is in the handling of residualAlpha for drag and
virtual mass to provide stable and physical phase velocities in the limit of the
phase-fraction -> 0.  The new approach is phase asymmetric such that the
residual drag is applied only to the phase with a phase-fraction less than
residualAlpha and not to the carrier phase.  This change ensures that the flow
of a pure phase is unaffected by the residualAlpha and residual drag of the
other phases that are stabilised in pure phase region.

There are now four options in the PIMPLE section of the fvSolutions dictionary
relating to the multiphase momentum/pressure algorithm:

PIMPLE
{
    faceMomentum        no;
    VmDdtCorrection     yes;
    dragCorrection      yes;
    partialElimination  no;
}

faceMomentum:
    Switches between the cell and face momentum equation algorithms.
    Provides much smoother and reliable solutions for even the most challenging
    multiphase cases at the expense of a noticeable loss in accuracy and resolution.
    Defaults to 'no'.

VmDdtCorrection:
    Includes the ddtCorr correction term to the time-derivative part of the
    virtual-mass term in the flux equation which ensures consistency between the
    phase virtual mass force on the faces but generates solutions which are
    slightly less smooth and more likely to contain numerical artefacts.
    Defaults to 'no'.

    Testing so far has shown that the loss in smoothness is small and there is
    some noticeable improvement is some cases so in the future the default may
    be changed to 'yes'.

dragCorrection:
    Includes the momentum corrector drag correction term to reduce the
    staggering patters generated in the velocity field due to sudden changes in
    drag force at the expense of a small error in drag consistency.
    Defaults to 'no'

partialElimination:
    Switches the partial-elimination momentum corrector which inverts the drag
    matrix for both the momentum equations and/or flux equations to provide a
    drag implicit correction to the phase velocity and flux fields.  The
    algorithm is the same as previously but updated for the new consistent drag
    interpolation.

All the tutorials/modules/multiphaseEuler tutorial cases have been updated and
tested with the above developments and the four options set appropriately for
each.
This commit is contained in:
Henry Weller
2023-03-30 12:27:48 +01:00
parent 21052fdcb1
commit a8cb8a61da
69 changed files with 863 additions and 734 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -44,11 +44,14 @@ SourceFiles
namespace Foam namespace Foam
{ {
class swarmCorrection;
namespace dragModels namespace dragModels
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class dispersedDragModel Declaration Class dispersedDragModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class dispersedDragModel class dispersedDragModel

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -46,8 +46,6 @@ SourceFiles
namespace Foam namespace Foam
{ {
class swarmCorrection;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class dragModel Declaration Class dragModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -83,8 +81,8 @@ public:
//- Coefficient dimensions //- Coefficient dimensions
static const dimensionSet dimK; static const dimensionSet dimK;
//- Does this model require correcting on fixed flux boundaries? //- This model MUST NOT be set to 0 on fixed flux boundaries
static const bool correctFixedFluxBCs = true; static const bool correctFixedFluxBCs = false;
// Constructors // Constructors

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -72,29 +72,16 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
const volScalarField& alpha1(interface_.phase1()); const volScalarField& alpha1(interface_.phase1());
const volScalarField& alpha2(interface_.phase2()); const volScalarField& alpha2(interface_.phase2());
const volScalarField& rho1(interface_.phase1().rho()); const volScalarField::Internal& rho1(interface_.phase1().rho());
const volScalarField& rho2(interface_.phase2().rho()); const volScalarField::Internal& rho2(interface_.phase2().rho());
tmp<volScalarField> tnu1(interface_.phase1().thermo().nu()); tmp<volScalarField> tnu1(interface_.phase1().thermo().nu());
tmp<volScalarField> tnu2(interface_.phase2().thermo().nu()); tmp<volScalarField> tnu2(interface_.phase2().thermo().nu());
const volScalarField& nu1(tnu1()); const volScalarField::Internal& nu1(tnu1());
const volScalarField& nu2(tnu2()); const volScalarField::Internal& nu2(tnu2());
volScalarField L const volScalarField::Internal L(cbrt(mesh.V()));
(
IOobject
(
"L",
mesh.time().name(),
mesh
),
mesh,
dimensionedScalar(dimLength, 0),
zeroGradientFvPatchField<scalar>::typeName
);
L.primitiveFieldRef() = cbrt(mesh.V());
L.correctBoundaryConditions();
const dimensionedScalar residualAlpha const dimensionedScalar residualAlpha
( (
@ -104,44 +91,67 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::segregated::K() const
)/2 )/2
); );
const volScalarField I1(alpha1/max(alpha1 + alpha2, residualAlpha)); const volScalarField I1
const volScalarField I2(alpha2/max(alpha1 + alpha2, residualAlpha)); (
const volScalarField magGradI alpha1/max(alpha1 + alpha2, residualAlpha)
);
const volScalarField I2
(
alpha2/max(alpha1 + alpha2, residualAlpha)
);
const volScalarField::Internal magGradI
( (
max max
( (
(rho2*mag(fvc::grad(I1)) + rho1*mag(fvc::grad(I2)))/(rho1 + rho2), (
rho2*mag(fvc::grad(I1)()())
+ rho1*mag(fvc::grad(I2)()())
)/(rho1 + rho2),
residualAlpha/2/L residualAlpha/2/L
) )
); );
const volScalarField muI(rho1*nu1*rho2*nu2/(rho1*nu1 + rho2*nu2)); const volScalarField::Internal muI(rho1*nu1*rho2*nu2/(rho1*nu1 + rho2*nu2));
const volScalarField limitedAlpha1 const volScalarField::Internal limitedAlpha1
( (
max(alpha1, interface_.phase1().residualAlpha()) max(alpha1, interface_.phase1().residualAlpha())
); );
const volScalarField limitedAlpha2 const volScalarField::Internal limitedAlpha2
( (
max(alpha2, interface_.phase2().residualAlpha()) max(alpha2, interface_.phase2().residualAlpha())
); );
const volScalarField muAlphaI const volScalarField::Internal muAlphaI
( (
limitedAlpha1*rho1*nu1*limitedAlpha2*rho2*nu2 limitedAlpha1*rho1*nu1*limitedAlpha2*rho2*nu2
/(limitedAlpha1*rho1*nu1 + limitedAlpha2*rho2*nu2) /(limitedAlpha1*rho1*nu1 + limitedAlpha2*rho2*nu2)
); );
const volScalarField ReI const volScalarField::Internal ReI
( (
interface_.rho()*interface_.magUr() (interface_.rho()()()*interface_.magUr()()())
/(magGradI*limitedAlpha1*limitedAlpha2*muI) /(magGradI*limitedAlpha1*limitedAlpha2*muI)
); );
const volScalarField lambda(m_*ReI + n_*muAlphaI/muI); const volScalarField::Internal lambda(m_*ReI + n_*muAlphaI/muI);
return lambda*sqr(magGradI)*muI; tmp<volScalarField> tK
(
volScalarField::New
(
"K",
mesh,
dimensionedScalar(dimK, 0),
zeroGradientFvPatchField<scalar>::typeName
)
);
tK.ref().ref() = lambda*sqr(magGradI)*muI;
tK.ref().correctBoundaryConditions();
return tK;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,14 +58,12 @@ Foam::virtualMassModels::dispersedVirtualMassModel::Ki() const
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::virtualMassModels::dispersedVirtualMassModel::K() const Foam::virtualMassModels::dispersedVirtualMassModel::K() const
{ {
return interface_.dispersed()*Ki(); return
} max
(
interface_.dispersed(),
Foam::tmp<Foam::surfaceScalarField> interface_.dispersed().residualAlpha()
Foam::virtualMassModels::dispersedVirtualMassModel::Kf() const )*Ki();
{
return fvc::interpolate(interface_.dispersed())*fvc::interpolate(Ki());
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -96,10 +96,6 @@ public:
// ddt(alpha1*rho1*U1) + ... = ... K*(DU1_Dt - DU2_Dt) // ddt(alpha1*rho1*U1) + ... = ... K*(DU1_Dt - DU2_Dt)
// ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt) // ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt)
virtual tmp<volScalarField> K() const; virtual tmp<volScalarField> K() const;
//- Return the virtual mass coefficient Kf
// used in the face-momentum equations
virtual tmp<surfaceScalarField> Kf() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -72,16 +72,4 @@ Foam::virtualMassModels::noVirtualMass::K() const
} }
Foam::tmp<Foam::surfaceScalarField>
Foam::virtualMassModels::noVirtualMass::Kf() const
{
return surfaceScalarField::New
(
"Kf",
interface_.mesh(),
dimensionedScalar(dimK, 0)
);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -85,10 +85,6 @@ public:
//- Return the virtual mass coefficient K //- Return the virtual mass coefficient K
// used in the momentum equations // used in the momentum equations
virtual tmp<volScalarField> K() const; virtual tmp<volScalarField> K() const;
//- Return the virtual mass coefficient Kf
// used in the face-momentum equations
virtual tmp<surfaceScalarField> Kf() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -81,10 +81,4 @@ Foam::tmp<Foam::volScalarField> Foam::blendedVirtualMassModel::K() const
} }
Foam::tmp<Foam::surfaceScalarField> Foam::blendedVirtualMassModel::Kf() const
{
return evaluate(&virtualMassModel::Kf, "Kf", virtualMassModel::dimK, false);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -81,8 +81,8 @@ public:
//- Coefficient dimensions //- Coefficient dimensions
static const dimensionSet dimK; static const dimensionSet dimK;
//- Does this model require correcting on fixed flux boundaries? //- This model should not be set to 0 on fixed flux boundaries
static const bool correctFixedFluxBCs = true; static const bool correctFixedFluxBCs = false;
// Constructors // Constructors
@ -119,10 +119,6 @@ public:
// ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt) // ddt(alpha2*rho2*U2) + ... = ... K*(DU1_Dt - DU2_Dt)
virtual tmp<volScalarField> K() const = 0; virtual tmp<volScalarField> K() const = 0;
//- Return the virtual mass coefficient Kf
// used in the face-momentum equations
virtual tmp<surfaceScalarField> Kf() const = 0;
// Dummy write for regIOobject // Dummy write for regIOobject
bool writeData(Ostream& os) const; bool writeData(Ostream& os) const;
}; };
@ -159,9 +155,6 @@ public:
//- Return the lift coefficient K //- Return the lift coefficient K
tmp<volScalarField> K() const; tmp<volScalarField> K() const;
//- Return the lift coefficient Kf
tmp<surfaceScalarField> Kf() const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -58,30 +58,39 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
rAUs.clear(); rAUs.clear();
rAUs.setSize(phases.size()); rAUs.setSize(phases.size());
PtrList<surfaceScalarField> rAUfs(phases.size());
PtrList<volScalarField> Kds(fluid.Kds());
forAll(fluid.movingPhases(), movingPhasei) forAll(fluid.movingPhases(), movingPhasei)
{ {
phaseModel& phase = fluid.movingPhases()[movingPhasei]; phaseModel& phase = fluid.movingPhases()[movingPhasei];
const volScalarField& alpha = phase; const volScalarField& alpha = phase;
const volScalarField AU
(
UEqns[phase.index()].A() + Kds[phase.index()]
+ byDt
(
max(phase.residualAlpha() - alpha, scalar(0))
*phase.rho()
)
);
rAUs.set rAUs.set
( (
phase.index(), phase.index(),
new volScalarField new volScalarField
( (
IOobject::groupName("rAU", phase.name()), IOobject::groupName("rAU", phase.name()),
1.0 1/AU
/(
UEqns[phase.index()].A()
+ byDt
(
max(phase.residualAlpha() - alpha, scalar(0))
*phase.rho()
)
)
) )
); );
rAUfs.set(phase.index(), 1/fvc::interpolate(AU));
} }
fluid.fillFields("rAU", dimTime/dimDensity, rAUs); fluid.fillFields("rAU", dimTime/dimDensity, rAUs);
fluid.fillFields("rAUf", dimTime/dimDensity, rAUfs);
// Phase diagonal coefficients // Phase diagonal coefficients
PtrList<surfaceScalarField> alpharAUfs(phases.size()); PtrList<surfaceScalarField> alpharAUfs(phases.size());
@ -94,13 +103,14 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
( (
phasei, phasei,
( (
fvc::interpolate(max(alpha, phase.residualAlpha())*rAUs[phasei]) fvc::interpolate(max(alpha, phase.residualAlpha()))
*rAUfs[phasei]
).ptr() ).ptr()
); );
} }
// Explicit force fluxes // Explicit force fluxes
PtrList<surfaceScalarField> phiFs(fluid.phiFs(rAUs)); PtrList<surfaceScalarField> Fs(fluid.Fs());
// Mass transfer rates // Mass transfer rates
PtrList<volScalarField> dmdts(fluid.dmdts()); PtrList<volScalarField> dmdts(fluid.dmdts());
@ -134,8 +144,7 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
( (
phasei, phasei,
( (
alpharAUfs[phasei] (
*(
ghSnGradRho ghSnGradRho
- (fvc::interpolate(phase.rho() - rho)) - (fvc::interpolate(phase.rho() - rho))
*(buoyancy.g & mesh.Sf()) *(buoyancy.g & mesh.Sf())
@ -143,11 +152,6 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
) )
).ptr() ).ptr()
); );
if (phiFs.set(phasei))
{
phigFs[phasei] += phiFs[phasei];
}
} }
} }
@ -156,21 +160,22 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
PtrList<surfaceScalarField> phiHbyAs(phases.size()); PtrList<surfaceScalarField> phiHbyAs(phases.size());
{ {
// Correction force fluxes // Correction force fluxes
PtrList<surfaceScalarField> ddtCorrByAs(fluid.ddtCorrByAs(rAUs)); PtrList<surfaceScalarField> ddtCorrs(fluid.ddtCorrs());
forAll(fluid.movingPhases(), movingPhasei) forAll(fluid.movingPhases(), movingPhasei)
{ {
phaseModel& phase = fluid.movingPhases()[movingPhasei]; phaseModel& phase = fluid.movingPhases()[movingPhasei];
const volScalarField& alpha = phase; const volScalarField& alpha = phase;
const label phasei = phase.index();
HbyAs.set HbyAs.set
( (
phase.index(), phasei,
constrainHbyA constrainHbyA
( (
rAUs[phase.index()] rAUs[phasei]
*( *(
UEqns[phase.index()].H() UEqns[phasei].H()
+ byDt + byDt
( (
max(phase.residualAlpha() - alpha, scalar(0)) max(phase.residualAlpha() - alpha, scalar(0))
@ -185,13 +190,17 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
phiHbyAs.set phiHbyAs.set
( (
phase.index(), phasei,
new surfaceScalarField new surfaceScalarField
( (
IOobject::groupName("phiHbyA", phase.name()), IOobject::groupName("phiHbyA", phase.name()),
fvc::flux(HbyAs[phase.index()]) rAUfs[phasei]
- phigFs[phase.index()] *(
- ddtCorrByAs[phase.index()] fvc::flux(HbyAs[phasei]/rAUs[phasei])
+ ddtCorrs[phasei]
)
- alpharAUfs[phasei]*phigFs[phasei]
- rAUfs[phasei]*Fs[phasei]
) )
); );
} }
@ -200,19 +209,19 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
fluid.fillFields("phiHbyA", dimForce/dimDensity/dimVelocity, phiHbyAs); fluid.fillFields("phiHbyA", dimForce/dimDensity/dimVelocity, phiHbyAs);
// Add explicit drag forces and fluxes // Add explicit drag forces and fluxes
PtrList<volVectorField> KdUByAs(fluid.KdUByAs(rAUs)); PtrList<volVectorField> KdUs(fluid.KdUs());
PtrList<surfaceScalarField> phiKdPhis(fluid.phiKdPhis(rAUs)); PtrList<surfaceScalarField> KdPhis(fluid.KdPhis());
forAll(phases, phasei) forAll(phases, phasei)
{ {
if (KdUByAs.set(phasei)) if (KdUs.set(phasei))
{ {
HbyAs[phasei] -= KdUByAs[phasei]; HbyAs[phasei] -= rAUs[phasei]*KdUs[phasei];
} }
if (phiKdPhis.set(phasei)) if (KdPhis.set(phasei))
{ {
phiHbyAs[phasei] -= phiKdPhis[phasei]; phiHbyAs[phasei] -= rAUfs[phasei]*KdPhis[phasei];
} }
} }
@ -255,6 +264,7 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
forAll(phases, phasei) forAll(phases, phasei)
{ {
rAUf += alphafs[phasei]*alpharAUfs[phasei]; rAUf += alphafs[phasei]*alpharAUfs[phasei];
// rAUf += alphafs[phasei]*alphafs[phasei]*rAUfs[phasei];
} }
rAUf = mag(rAUf); rAUf = mag(rAUf);
@ -346,22 +356,54 @@ void Foam::solvers::multiphaseEuler::cellPressureCorrector()
mSfGradp = pEqnIncomp.flux()/rAUf; mSfGradp = pEqnIncomp.flux()/rAUf;
forAll(fluid.movingPhases(), movingPhasei) if (!dragCorrection)
{ {
phaseModel& phase = fluid.movingPhases()[movingPhasei]; forAll(fluid.movingPhases(), movingPhasei)
{
phaseModel& phase = fluid.movingPhases()[movingPhasei];
const label phasei = phase.index();
phase.URef() = phase.URef() =
HbyAs[phase.index()] HbyAs[phasei]
+ fvc::reconstruct + fvc::reconstruct
( (
alpharAUfs[phase.index()]*mSfGradp alpharAUfs[phasei]*(mSfGradp - phigFs[phasei])
- phigFs[phase.index()] - rAUfs[phasei]*Fs[phasei]
); );
}
}
else
{
PtrList<volVectorField> dragCorrs(phases.size());
PtrList<surfaceScalarField> dragCorrfs(phases.size());
fluid.dragCorrs(dragCorrs, dragCorrfs);
forAll(fluid.movingPhases(), movingPhasei)
{
phaseModel& phase = fluid.movingPhases()[movingPhasei];
const label phasei = phase.index();
phase.URef() =
HbyAs[phasei]
+ fvc::reconstruct
(
alpharAUfs[phasei]*(mSfGradp - phigFs[phasei])
+ rAUfs[phasei]*(dragCorrfs[phasei] - Fs[phasei])
)
- rAUs[phasei]*dragCorrs[phasei];
}
} }
if (partialElimination) if (partialElimination)
{ {
fluid.partialElimination(rAUs, KdUByAs, alphafs, phiKdPhis); fluid.partialElimination
(
rAUs,
KdUs,
alphafs,
rAUfs,
KdPhis
);
} }
else else
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2022-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -71,7 +71,7 @@ void Foam::solvers::multiphaseEuler::facePressureCorrector()
rAUfs.clear(); rAUfs.clear();
rAUfs.setSize(phases.size()); rAUfs.setSize(phases.size());
{ {
PtrList<surfaceScalarField> AFfs(fluid.AFfs()); PtrList<surfaceScalarField> KdVmfs(fluid.KdVmfs());
forAll(fluid.movingPhases(), movingPhasei) forAll(fluid.movingPhases(), movingPhasei)
{ {
@ -87,7 +87,7 @@ void Foam::solvers::multiphaseEuler::facePressureCorrector()
/( /(
byDt(alphaRho0fs[phase.index()]) byDt(alphaRho0fs[phase.index()])
+ fvc::interpolate(UEqns[phase.index()].A()) + fvc::interpolate(UEqns[phase.index()].A())
+ AFfs[phase.index()] + KdVmfs[phase.index()]
) )
) )
); );
@ -111,7 +111,7 @@ void Foam::solvers::multiphaseEuler::facePressureCorrector()
} }
// Explicit force fluxes // Explicit force fluxes
PtrList<surfaceScalarField> phiFfs(fluid.phiFfs(rAUfs)); PtrList<surfaceScalarField> Ffs(fluid.Ffs());
// Mass transfer rates // Mass transfer rates
PtrList<volScalarField> dmdts(fluid.dmdts()); PtrList<volScalarField> dmdts(fluid.dmdts());
@ -155,9 +155,9 @@ void Foam::solvers::multiphaseEuler::facePressureCorrector()
).ptr() ).ptr()
); );
if (phiFfs.set(phasei)) if (Ffs.set(phasei))
{ {
phigFs[phasei] += phiFfs[phasei]; phigFs[phasei] += rAUfs[phasei]*Ffs[phasei];
} }
} }
} }
@ -193,13 +193,13 @@ void Foam::solvers::multiphaseEuler::facePressureCorrector()
fluid.fillFields("phiHbyA", dimForce/dimDensity/dimVelocity, phiHbyAs); fluid.fillFields("phiHbyA", dimForce/dimDensity/dimVelocity, phiHbyAs);
// Add explicit drag forces and fluxes // Add explicit drag forces and fluxes
PtrList<surfaceScalarField> phiKdPhifs(fluid.phiKdPhifs(rAUfs)); PtrList<surfaceScalarField> KdPhifs(fluid.KdPhifs());
forAll(phases, phasei) forAll(phases, phasei)
{ {
if (phiKdPhifs.set(phasei)) if (KdPhifs.set(phasei))
{ {
phiHbyAs[phasei] -= phiKdPhifs[phasei]; phiHbyAs[phasei] -= rAUfs[phasei]*KdPhifs[phasei];
} }
} }
@ -330,7 +330,7 @@ void Foam::solvers::multiphaseEuler::facePressureCorrector()
if (partialElimination) if (partialElimination)
{ {
fluid.partialEliminationf(rAUfs, alphafs, phiKdPhifs); fluid.partialEliminationf(rAUfs, alphafs, KdPhifs);
} }
else else
{ {

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "multiphaseEuler.H" #include "multiphaseEuler.H"
#include "fvmSup.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -37,6 +38,8 @@ void Foam::solvers::multiphaseEuler::cellMomentumPredictor()
phaseSystem::momentumTransferTable& phaseSystem::momentumTransferTable&
momentumTransfer(momentumTransferPtr()); momentumTransfer(momentumTransferPtr());
const PtrList<volScalarField> Kds(fluid.Kds());
forAll(fluid.movingPhases(), movingPhasei) forAll(fluid.movingPhases(), movingPhasei)
{ {
phaseModel& phase = fluid.movingPhases()[movingPhasei]; phaseModel& phase = fluid.movingPhases()[movingPhasei];
@ -54,6 +57,7 @@ void Foam::solvers::multiphaseEuler::cellMomentumPredictor()
== ==
*momentumTransfer[phase.name()] *momentumTransfer[phase.name()]
+ fvModels().source(alpha, rho, U) + fvModels().source(alpha, rho, U)
// - fvm::Sp(Kds[phase.index()], U)
) )
); );

View File

@ -52,6 +52,9 @@ void Foam::solvers::multiphaseEuler::readControls()
faceMomentum = faceMomentum =
pimple.dict().lookupOrDefault<Switch>("faceMomentum", false); pimple.dict().lookupOrDefault<Switch>("faceMomentum", false);
dragCorrection =
pimple.dict().lookupOrDefault<Switch>("dragCorrection", false);
partialElimination = partialElimination =
pimple.dict().lookupOrDefault<Switch>("partialElimination", false); pimple.dict().lookupOrDefault<Switch>("partialElimination", false);
@ -97,6 +100,11 @@ Foam::solvers::multiphaseEuler::multiphaseEuler(fvMesh& mesh)
pimple.dict().lookupOrDefault<Switch>("faceMomentum", false) pimple.dict().lookupOrDefault<Switch>("faceMomentum", false)
), ),
dragCorrection
(
pimple.dict().lookupOrDefault<Switch>("dragCorrection", false)
),
partialElimination partialElimination
( (
pimple.dict().lookupOrDefault<Switch>("partialElimination", false) pimple.dict().lookupOrDefault<Switch>("partialElimination", false)

View File

@ -81,6 +81,10 @@ protected:
// Defaults to false, i.e. uses the cell momentum equation // Defaults to false, i.e. uses the cell momentum equation
Switch faceMomentum; Switch faceMomentum;
//- Cell/face drag correction for cell momentum corrector
// Defaults to false
Switch dragCorrection;
//- Partial elimination drag contribution optimisation //- Partial elimination drag contribution optimisation
// Defaults to false // Defaults to false
Switch partialElimination; Switch partialElimination;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,8 +63,6 @@ class MomentumTransferPhaseSystem
: :
public BasePhaseSystem public BasePhaseSystem
{ {
private:
// Private typedefs // Private typedefs
typedef HashPtrTable typedef HashPtrTable
@ -88,13 +86,6 @@ private:
phaseInterfaceKey::hash phaseInterfaceKey::hash
> VmTable; > VmTable;
typedef HashPtrTable
<
surfaceScalarField,
phaseInterfaceKey,
phaseInterfaceKey::hash
> VmfTable;
typedef HashTable typedef HashTable
< <
autoPtr<blendedDragModel>, autoPtr<blendedDragModel>,
@ -142,9 +133,6 @@ private:
//- Virtual mass coefficients //- Virtual mass coefficients
VmTable Vms_; VmTable Vms_;
//- Face virtual mass coefficients
VmfTable Vmfs_;
// Sub Models // Sub Models
@ -206,72 +194,33 @@ public:
//- Return implicit force coefficients on the faces, for the face-based //- Return implicit force coefficients on the faces, for the face-based
// algorithm. // algorithm.
virtual PtrList<surfaceScalarField> AFfs() const; virtual PtrList<surfaceScalarField> KdVmfs() const;
//- Return the explicit force fluxes for the cell-based algorithm, that //- Return the explicit force fluxes for the cell-based algorithm, that
// do not depend on phase mass/volume fluxes, and can therefore be // do not depend on phase mass/volume fluxes, and can therefore be
// evaluated outside the corrector loop. This includes things like // evaluated outside the corrector loop. This includes things like
// lift, turbulent dispersion, and wall lubrication. // lift, turbulent dispersion, and wall lubrication.
virtual PtrList<surfaceScalarField> phiFs virtual PtrList<surfaceScalarField> Fs();
(
const PtrList<volScalarField>& rAUs
);
//- As phiFs, but for the face-based algorithm //- As Fs, but for the face-based algorithm
virtual PtrList<surfaceScalarField> phiFfs virtual PtrList<surfaceScalarField> Ffs();
(
const PtrList<surfaceScalarField>& rAUfs
);
//- Return the explicit drag force fluxes for the cell-based algorithm. //- Return the explicit drag force fluxes for the cell-based algorithm.
// These depend on phase mass/volume fluxes, and must therefore be // These depend on phase mass/volume fluxes, and must therefore be
// evaluated inside the corrector loop. // evaluated inside the corrector loop.
virtual PtrList<surfaceScalarField> phiKdPhis virtual PtrList<surfaceScalarField> KdPhis() const;
(
const PtrList<volScalarField>& rAUs
) const;
//- As phiKdPhis, but for the face-based algorithm //- As KdPhis, but for the face-based algorithm
virtual PtrList<surfaceScalarField> phiKdPhifs virtual PtrList<surfaceScalarField> KdPhifs() const;
(
const PtrList<surfaceScalarField>& rAUfs //- Return the implicit part of the drag force
) const; virtual PtrList<volScalarField> Kds() const;
//- Return the explicit part of the drag force for the cell-based //- Return the explicit part of the drag force for the cell-based
// algorithm. This is the cell-equivalent of phiKdPhis. These depend on // algorithm. This is the cell-equivalent of KdPhis. These depend on
// phase velocities, and must therefore be evaluated inside the // phase velocities, and must therefore be evaluated inside the
// corrector loop. // corrector loop.
virtual PtrList<volVectorField> KdUByAs virtual PtrList<volVectorField> KdUs() const;
(
const PtrList<volScalarField>& rAUs
) const;
//- Solve the drag system for the velocities and fluxes
virtual void partialElimination
(
const PtrList<volScalarField>& rAUs,
const PtrList<volVectorField>& KdUByAs,
const PtrList<surfaceScalarField>& alphafs,
const PtrList<surfaceScalarField>& phiKdPhis
);
//- As partialElimination, but for the face-based algorithm. Only solves
// for the fluxes.
virtual void partialEliminationf
(
const PtrList<surfaceScalarField>& rAUfs,
const PtrList<surfaceScalarField>& alphafs,
const PtrList<surfaceScalarField>& phiKdPhifs
);
//- Return the flux corrections for the cell-based algorithm. These
// depend on phase mass/volume fluxes, and must therefore be evaluated
// inside the corrector loop.
virtual PtrList<surfaceScalarField> ddtCorrByAs
(
const PtrList<volScalarField>& rAUs,
const bool includeVirtualMass = false
) const;
//- Returns true if the phase pressure is treated implicitly //- Returns true if the phase pressure is treated implicitly
// in the phase fraction equation // in the phase fraction equation
@ -289,6 +238,40 @@ public:
const PtrList<surfaceScalarField>& rAUfs const PtrList<surfaceScalarField>& rAUfs
) const; ) const;
//- Return the flux corrections for the cell-based algorithm. These
// depend on phase mass/volume fluxes, and must therefore be evaluated
// inside the corrector loop.
virtual PtrList<surfaceScalarField> ddtCorrs
(
const bool includeVirtualMass = false
) const;
//- Set the cell and faces drag correction fields
virtual void dragCorrs
(
PtrList<volVectorField>& dragCorrs,
PtrList<surfaceScalarField>& dragCorrf
) const;
//- Solve the drag system for the velocities and fluxes
virtual void partialElimination
(
const PtrList<volScalarField>& rAUs,
const PtrList<volVectorField>& KdUs,
const PtrList<surfaceScalarField>& alphafs,
const PtrList<surfaceScalarField>& rAUfs,
const PtrList<surfaceScalarField>& KdPhis
);
//- As partialElimination, but for the face-based algorithm. Only solves
// for the fluxes.
virtual void partialEliminationf
(
const PtrList<surfaceScalarField>& rAUfs,
const PtrList<surfaceScalarField>& alphafs,
const PtrList<surfaceScalarField>& KdPhifs
);
//- Read base phaseProperties dictionary //- Read base phaseProperties dictionary
virtual bool read(); virtual bool read();
}; };

View File

@ -212,7 +212,7 @@ void Foam::diameterModels::velocityGroup::correct()
const populationBalanceModel& popBal = const populationBalanceModel& popBal =
phase().mesh().lookupObject<populationBalanceModel>(popBalName_); phase().mesh().lookupObject<populationBalanceModel>(popBalName_);
if (!popBal.solveOnFinalIterOnly() || popBal.pimple().finalIter()) if (!popBal.solveOnFinalIterOnly() || popBal.fluid().pimple().finalIter())
{ {
forAll(sizeGroups_, i) forAll(sizeGroups_, i)
{ {

View File

@ -141,9 +141,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
( (
IOobject::groupName("alphaPhi", this->name()), IOobject::groupName("alphaPhi", this->name()),
fluid.mesh().time().name(), fluid.mesh().time().name(),
fluid.mesh(), fluid.mesh()
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
), ),
fluid.mesh(), fluid.mesh(),
dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), 0) dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), 0)
@ -154,9 +152,7 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel
( (
IOobject::groupName("alphaRhoPhi", this->name()), IOobject::groupName("alphaRhoPhi", this->name()),
fluid.mesh().time().name(), fluid.mesh().time().name(),
fluid.mesh(), fluid.mesh()
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
), ),
fluid.mesh(), fluid.mesh(),
dimensionedScalar(dimensionSet(1, 0, -1, 0, 0), 0) dimensionedScalar(dimensionSet(1, 0, -1, 0, 0), 0)

View File

@ -225,6 +225,8 @@ Foam::phaseSystem::phaseSystem
mesh_(mesh), mesh_(mesh),
pimple_(mesh_.lookupObject<pimpleNoLoopControl>("solutionControl")),
MRF_(mesh_), MRF_(mesh_),
referencePhaseName_(lookupOrDefault("referencePhase", word::null)), referencePhaseName_(lookupOrDefault("referencePhase", word::null)),

View File

@ -45,6 +45,8 @@ SourceFiles
#include "PtrListDictionary.H" #include "PtrListDictionary.H"
#include "hashedWordList.H" #include "hashedWordList.H"
#include "pimpleNoLoopControl.H"
#include "IOMRFZoneList.H" #include "IOMRFZoneList.H"
#include "fvModels.H" #include "fvModels.H"
#include "fvConstraints.H" #include "fvConstraints.H"
@ -126,6 +128,9 @@ protected:
//- Reference to the mesh //- Reference to the mesh
const fvMesh& mesh_; const fvMesh& mesh_;
//- Reference to pimpleNoLoopControl
const pimpleNoLoopControl& pimple_;
//- Optional MRF zones //- Optional MRF zones
IOMRFZoneList MRF_; IOMRFZoneList MRF_;
@ -273,6 +278,9 @@ public:
//- Return the mesh //- Return the mesh
inline const fvMesh& mesh() const; inline const fvMesh& mesh() const;
//- Return pimpleNoLoopControl
inline const pimpleNoLoopControl& pimple() const;
//- Return the phase models //- Return the phase models
inline const phaseModelList& phases() const; inline const phaseModelList& phases() const;
@ -515,37 +523,25 @@ public:
//- Return the implicit force coefficients for the face-based //- Return the implicit force coefficients for the face-based
// algorithm // algorithm
virtual PtrList<surfaceScalarField> AFfs() const = 0; virtual PtrList<surfaceScalarField> KdVmfs() const = 0;
//- Return the force fluxes for the cell-based algorithm //- Return the force fluxes for the cell-based algorithm
virtual PtrList<surfaceScalarField> phiFs virtual PtrList<surfaceScalarField> Fs() = 0;
(
const PtrList<volScalarField>& rAUs
) = 0;
//- Return the force fluxes for the face-based algorithm //- Return the force fluxes for the face-based algorithm
virtual PtrList<surfaceScalarField> phiFfs virtual PtrList<surfaceScalarField> Ffs() = 0;
(
const PtrList<surfaceScalarField>& rAUfs
) = 0;
//- Return the force fluxes for the cell-based algorithm //- Return the force fluxes for the cell-based algorithm
virtual PtrList<surfaceScalarField> phiKdPhis virtual PtrList<surfaceScalarField> KdPhis() const = 0;
(
const PtrList<volScalarField>& rAUs
) const = 0;
//- Return the force fluxes for the face-based algorithm //- Return the force fluxes for the face-based algorithm
virtual PtrList<surfaceScalarField> phiKdPhifs virtual PtrList<surfaceScalarField> KdPhifs() const = 0;
(
const PtrList<surfaceScalarField>& rAUfs //- Return the implicit part of the drag force
) const = 0; virtual PtrList<volScalarField> Kds() const = 0;
//- Return the explicit part of the drag force //- Return the explicit part of the drag force
virtual PtrList<volVectorField> KdUByAs virtual PtrList<volVectorField> KdUs() const = 0;
(
const PtrList<volScalarField>& rAUs
) const = 0;
//- Returns true if the phase pressure is treated implicitly //- Returns true if the phase pressure is treated implicitly
// in the phase fraction equation // in the phase fraction equation
@ -563,13 +559,27 @@ public:
const PtrList<surfaceScalarField>& rAUfs const PtrList<surfaceScalarField>& rAUfs
) const = 0; ) const = 0;
//- Return the flux corrections for the cell-based algorithm
virtual PtrList<surfaceScalarField> ddtCorrs
(
const bool includeVirtualMass = false
) const = 0;
//- Set the cell and faces drag correction fields
virtual void dragCorrs
(
PtrList<volVectorField>& dragCorrs,
PtrList<surfaceScalarField>& dragCorrf
) const = 0;
//- Solve the drag system for the new velocities and fluxes //- Solve the drag system for the new velocities and fluxes
virtual void partialElimination virtual void partialElimination
( (
const PtrList<volScalarField>& rAUs, const PtrList<volScalarField>& rAUs,
const PtrList<volVectorField>& KdUByAs, const PtrList<volVectorField>& KdUs,
const PtrList<surfaceScalarField>& alphafs, const PtrList<surfaceScalarField>& alphafs,
const PtrList<surfaceScalarField>& phiKdPhis const PtrList<surfaceScalarField>& rAUfs,
const PtrList<surfaceScalarField>& KdPhis
) = 0; ) = 0;
//- Solve the drag system for the new fluxes //- Solve the drag system for the new fluxes
@ -577,7 +587,7 @@ public:
( (
const PtrList<surfaceScalarField>& rAUfs, const PtrList<surfaceScalarField>& rAUfs,
const PtrList<surfaceScalarField>& alphafs, const PtrList<surfaceScalarField>& alphafs,
const PtrList<surfaceScalarField>& phiKdPhifs const PtrList<surfaceScalarField>& KdPhifs
) = 0; ) = 0;
//- Re-normalise the flux of the phases //- Re-normalise the flux of the phases
@ -588,13 +598,6 @@ public:
const surfaceScalarField& phim const surfaceScalarField& phim
); );
//- Return the flux corrections for the cell-based algorithm
virtual PtrList<surfaceScalarField> ddtCorrByAs
(
const PtrList<volScalarField>& rAUs,
const bool includeVirtualMass = false
) const = 0;
//- Return the heat transfer matrices //- Return the heat transfer matrices
virtual autoPtr<heatTransferTable> heatTransfer() const = 0; virtual autoPtr<heatTransferTable> heatTransfer() const = 0;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2014-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2014-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,6 +31,12 @@ inline const Foam::fvMesh& Foam::phaseSystem::mesh() const
} }
inline const Foam::pimpleNoLoopControl& Foam::phaseSystem::pimple() const
{
return pimple_;
}
inline const Foam::phaseSystem::phaseModelList& inline const Foam::phaseSystem::phaseModelList&
Foam::phaseSystem::phases() const Foam::phaseSystem::phases() const
{ {

View File

@ -797,7 +797,6 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
( (
fluid_.subDict("populationBalanceCoeffs").subDict(name_) fluid_.subDict("populationBalanceCoeffs").subDict(name_)
), ),
pimple_(mesh_.lookupObject<pimpleNoLoopControl>("solutionControl")),
continuousPhase_ continuousPhase_
( (
mesh_.lookupObject<phaseModel> mesh_.lookupObject<phaseModel>
@ -1130,7 +1129,7 @@ Foam::diameterModels::populationBalanceModel::continuousTurbulence() const
void Foam::diameterModels::populationBalanceModel::solve() void Foam::diameterModels::populationBalanceModel::solve()
{ {
if (!solveOnFinalIterOnly() || pimple_.finalIter()) if (!solveOnFinalIterOnly() || fluid_.pimple().finalIter())
{ {
const label nCorr = this->nCorr(); const label nCorr = this->nCorr();
const scalar tolerance = const scalar tolerance =

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -206,7 +206,6 @@ SourceFiles
#include "sizeGroup.H" #include "sizeGroup.H"
#include "phaseSystem.H" #include "phaseSystem.H"
#include "pimpleNoLoopControl.H"
#include "phaseCompressibleMomentumTransportModel.H" #include "phaseCompressibleMomentumTransportModel.H"
#include "HashPtrTable.H" #include "HashPtrTable.H"
#include "Pair.H" #include "Pair.H"
@ -232,8 +231,6 @@ class populationBalanceModel
: :
public regIOobject public regIOobject
{ {
private:
// Private Data // Private Data
//- Reference to the phaseSystem //- Reference to the phaseSystem
@ -251,9 +248,6 @@ private:
//- Dictionary //- Dictionary
dictionary dict_; dictionary dict_;
//- Reference to pimpleNoLoopControl
const pimpleNoLoopControl& pimple_;
//- Continuous phase //- Continuous phase
const phaseModel& continuousPhase_; const phaseModel& continuousPhase_;
@ -438,9 +432,6 @@ public:
//- Return populationBalanceCoeffs dictionary //- Return populationBalanceCoeffs dictionary
inline const dictionary& dict() const; inline const dictionary& dict() const;
//- Return pimpleNoLoopControl
const pimpleNoLoopControl& pimple() const;
//- Return the number of corrections //- Return the number of corrections
inline label nCorr() const; inline label nCorr() const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation \\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -64,13 +64,6 @@ Foam::diameterModels::populationBalanceModel::dict() const
} }
inline const Foam::pimpleNoLoopControl&
Foam::diameterModels::populationBalanceModel::pimple() const
{
return pimple_;
}
inline Foam::label Foam::diameterModels::populationBalanceModel::nCorr() const inline Foam::label Foam::diameterModels::populationBalanceModel::nCorr() const
{ {
return mesh_.solution().solverDict(name_).lookup<label>("nCorr"); return mesh_.solution().solverDict(name_).lookup<label>("nCorr");

View File

@ -74,7 +74,10 @@ PIMPLE
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
nEnergyCorrectors 1; nEnergyCorrectors 1;
faceMomentum yes; faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -69,13 +69,7 @@ drag
} }
virtualMass virtualMass
{ {}
solids_dispersedIn_gas
{
type constantCoefficient;
Cvm 0;
}
}
heatTransfer heatTransfer
{ {

View File

@ -89,8 +89,10 @@ PIMPLE
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum yes; faceMomentum no;
VmDdtCorrection no;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -27,7 +27,7 @@ boundaryField
outlet outlet
{ {
type prghPressure; type prghPressure;
p $internalField; p $internalField;
value $internalField; value $internalField;
} }
walls walls

View File

@ -69,6 +69,11 @@ PIMPLE
nOuterCorrectors 3; nOuterCorrectors 3;
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -69,6 +69,11 @@ PIMPLE
nOuterCorrectors 5; nOuterCorrectors 5;
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -66,6 +66,11 @@ PIMPLE
nOuterCorrectors 5; nOuterCorrectors 5;
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -78,6 +78,11 @@ PIMPLE
nOuterCorrectors 5; nOuterCorrectors 5;
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -60,6 +60,10 @@ PIMPLE
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -69,6 +69,11 @@ PIMPLE
nOuterCorrectors 3; nOuterCorrectors 3;
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -61,6 +61,10 @@ PIMPLE
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -70,8 +70,10 @@ PIMPLE
nCorrectors 2; nCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum true; faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -34,7 +34,7 @@ writeInterval 0.02;
purgeWrite 0; purgeWrite 0;
writeFormat binary; writeFormat ascii;
writePrecision 6; writePrecision 6;
@ -53,5 +53,9 @@ maxAlphaCo 0.5;
maxDeltaT 1; maxDeltaT 1;
functions
{
#includeFunc phaseMap
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -76,6 +76,11 @@ PIMPLE
{ {
nCorrectors 3; nCorrectors 3;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection no;
dragCorrection no;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -88,8 +88,9 @@ PIMPLE
nCorrectors 2; nCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no; faceMomentum no;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -66,20 +66,14 @@ drag
} }
virtualMass virtualMass
{ {}
particles_dispersedIn_air
{
type constantCoefficient;
Cvm 0.5;
}
}
heatTransfer heatTransfer
{ {
particles_dispersedIn_air particles_dispersedIn_air
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-3; residualAlpha 1e-4;
} }
} }

View File

@ -84,12 +84,13 @@ solvers
PIMPLE PIMPLE
{ {
nOuterCorrectors 3; nOuterCorrectors 3;
nCorrectors 2; nCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no; faceMomentum no;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -81,6 +81,9 @@ PIMPLE
transportCorrectionFinal yes; transportCorrectionFinal yes;
faceMomentum no; faceMomentum no;
VmDdtCorrection no;
dragCorrection yes;
partialElimination no;
} }
cache cache

View File

@ -65,13 +65,7 @@ blending
} }
surfaceTension surfaceTension
{ {}
air_water
{
type constant;
sigma 0.07;
}
}
drag drag
{ {
@ -103,8 +97,7 @@ virtualMass
water_dispersedIn_air water_dispersedIn_air
{ {
type constantCoefficient; type none;
Cvm 0.5;
} }
} }

View File

@ -61,6 +61,10 @@ PIMPLE
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -33,7 +33,7 @@ water
oil oil
{ {
type pureIsothermalPhaseModel; type pureIsothermalPhaseModel;
diameterModel constant; diameterModel constant;
constantCoeffs constantCoeffs
{ {
d 1e-3; d 1e-3;
@ -45,7 +45,7 @@ oil
mercury mercury
{ {
type pureIsothermalPhaseModel; type pureIsothermalPhaseModel;
diameterModel constant; diameterModel constant;
constantCoeffs constantCoeffs
{ {
d 1e-3; d 1e-3;

View File

@ -22,7 +22,7 @@ thermoType
thermo hConst; thermo hConst;
equationOfState rhoConst; equationOfState rhoConst;
specie specie; specie specie;
energy sensibleEnthalpy; energy sensibleInternalEnergy;
} }
mixture mixture

View File

@ -22,7 +22,7 @@ thermoType
thermo hConst; thermo hConst;
equationOfState rhoConst; equationOfState rhoConst;
specie specie; specie specie;
energy sensibleEnthalpy; energy sensibleInternalEnergy;
} }
mixture mixture

View File

@ -22,7 +22,7 @@ thermoType
thermo eConst; thermo eConst;
equationOfState rPolynomial; equationOfState rPolynomial;
specie specie; specie specie;
energy sensibleEnthalpy; energy sensibleInternalEnergy;
} }
mixture mixture

View File

@ -94,6 +94,11 @@ PIMPLE
correctPhi yes; correctPhi yes;
correctMeshPhi no; correctMeshPhi no;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -81,6 +81,11 @@ PIMPLE
pRefCell 0; pRefCell 0;
pRefValue 0; pRefValue 0;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -53,19 +53,19 @@ solvers
"(k|epsilon).*" "(k|epsilon).*"
{ {
solver PBiCGStab; solver PBiCGStab;
preconditioner DILU; preconditioner DILU;
tolerance 1e-5; tolerance 1e-5;
relTol 0; relTol 0;
minIter 1; minIter 1;
} }
"f.*" "f.*"
{ {
solver PBiCGStab; solver PBiCGStab;
preconditioner DILU; preconditioner DILU;
tolerance 1e-6; tolerance 1e-6;
relTol 0; relTol 0;
} }
agglomerates agglomerates
@ -85,6 +85,11 @@ PIMPLE
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
alphaSpreadMin 5e-4; alphaSpreadMin 5e-4;
alphaSpreadMax 0.9995; alphaSpreadMax 0.9995;
faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -20,10 +20,12 @@ internalField uniform 372.76;
boundaryField boundaryField
{ {
walls inlet
{ {
type zeroGradient; type fixedValue;
value $internalField;
} }
outlet outlet
{ {
type inletOutlet; type inletOutlet;
@ -31,10 +33,10 @@ boundaryField
inletValue $internalField; inletValue $internalField;
value $internalField; value $internalField;
} }
inlet
walls
{ {
type fixedValue; type zeroGradient;
value $internalField;
} }
} }

View File

@ -20,11 +20,11 @@ internalField uniform 360;
boundaryField boundaryField
{ {
walls inlet
{ {
type fixedValue; type zeroGradient;
value $internalField;
} }
outlet outlet
{ {
type inletOutlet; type inletOutlet;
@ -32,9 +32,11 @@ boundaryField
inletValue $internalField; inletValue $internalField;
value $internalField; value $internalField;
} }
inlet
walls
{ {
type zeroGradient; type fixedValue;
value $internalField;
} }
} }

View File

@ -16,21 +16,23 @@ FoamFile
dimensions [0 1 -1 0 0 0 0]; dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0.1 0); internalField uniform (0 0 0);
boundaryField boundaryField
{ {
inlet inlet
{ {
type fixedValue; type fixedValue;
value uniform (0 0.1 0); value uniform (0 0 0);
} }
outlet outlet
{ {
type pressureInletOutletVelocity; type pressureInletOutletVelocity;
phi phi.steam; phi phi.steam;
value $internalField; value $internalField;
} }
walls walls
{ {
type noSlip; type noSlip;

View File

@ -25,12 +25,14 @@ boundaryField
type fixedValue; type fixedValue;
value uniform (0 0.1 0); value uniform (0 0.1 0);
} }
outlet outlet
{ {
type pressureInletOutletVelocity; type pressureInletOutletVelocity;
phi phi.water; phi phi.water;
value $internalField; value $internalField;
} }
walls walls
{ {
type noSlip; type noSlip;

View File

@ -23,8 +23,9 @@ boundaryField
inlet inlet
{ {
type fixedValue; type fixedValue;
value uniform 0.; value uniform 0;
} }
outlet outlet
{ {
type inletOutlet; type inletOutlet;
@ -32,14 +33,11 @@ boundaryField
inletValue uniform 0; inletValue uniform 0;
value uniform 0; value uniform 0;
} }
walls walls
{ {
type zeroGradient; type zeroGradient;
} }
defaultFaces
{
type empty;
}
} }

View File

@ -23,23 +23,21 @@ boundaryField
inlet inlet
{ {
type fixedValue; type fixedValue;
value uniform 1.; value uniform 1;
} }
outlet outlet
{ {
type inletOutlet; type inletOutlet;
phi phi.water; phi phi.water;
inletValue uniform 1.0; inletValue uniform 1;
value uniform 1.0; value uniform 1;
} }
walls walls
{ {
type zeroGradient; type zeroGradient;
} }
defaultFaces
{
type empty;
}
} }

View File

@ -25,11 +25,13 @@ boundaryField
type calculated; type calculated;
value $internalField; value $internalField;
} }
outlet outlet
{ {
type calculated; type calculated;
value $internalField; value $internalField;
} }
walls walls
{ {
type nutkWallFunction; type nutkWallFunction;

View File

@ -24,11 +24,13 @@ boundaryField
type calculated; type calculated;
value $internalField; value $internalField;
} }
outlet outlet
{ {
type calculated; type calculated;
value $internalField; value $internalField;
} }
walls walls
{ {
type calculated; type calculated;

View File

@ -24,12 +24,17 @@ boundaryField
type fixedFluxPressure; type fixedFluxPressure;
value $internalField; value $internalField;
} }
outlet outlet
{ {
type prghPressure; type prghTotalPressure;
p $internalField; p0 $internalField;
U U.water;
phi phi.water;
rho rho.water;
value $internalField; value $internalField;
} }
walls walls
{ {
type fixedFluxPressure; type fixedFluxPressure;

View File

@ -1,41 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
location "0";
object AIR.steam;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
inlet
{
type fixedValue;
value uniform 1;
}
outlet
{
type inletOutlet;
phi phi.steam;
inletValue $internalField;
value $internalField;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -1,41 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class volScalarField;
location "0";
object AIR.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
phi phi.water;
inletValue $internalField;
value $internalField;
}
walls
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -51,13 +51,7 @@ blending
} }
surfaceTension surfaceTension
{ {}
steam_water
{
type constant;
sigma 0.07;
}
}
saturationTemperature saturationTemperature
{ {
@ -90,13 +84,13 @@ heatTransfer
steam_dispersedIn_water_inThe_steam steam_dispersedIn_water_inThe_steam
{ {
type spherical; type spherical;
residualAlpha 1e-4; residualAlpha 1e-3;
} }
steam_dispersedIn_water_inThe_water steam_dispersedIn_water_inThe_water
{ {
type RanzMarshall; type RanzMarshall;
residualAlpha 1e-4; residualAlpha 1e-3;
} }
} }

View File

@ -24,10 +24,12 @@ solvers
p_rgh p_rgh
{ {
solver PCG; solver GAMG;
preconditioner DIC; smoother DIC;
tolerance 1e-10;
relTol 0.001; tolerance 1e-8;
relTol 0.01;
maxIter 20;
} }
p_rghFinal p_rghFinal
@ -38,50 +40,53 @@ solvers
"U.*" "U.*"
{ {
solver smoothSolver; solver PBiCGStab;
smoother symGaussSeidel; preconditioner DILU;
tolerance 1e-6; tolerance 1e-6;
relTol 0; relTol 0;
minIter 1;
} }
"(e|h).*" "(e|h).*"
{ {
solver smoothSolver; solver PBiCGStab;
smoother symGaussSeidel; preconditioner DILU;
tolerance 1e-6;
tolerance 1e-8;
relTol 0; relTol 0;
minIter 1;
maxIter 20; maxIter 20;
} }
"(k|epsilon).*" "(k|epsilon).*"
{ {
solver smoothSolver; solver PBiCGStab;
smoother symGaussSeidel; preconditioner DILU;
tolerance 1e-8; tolerance 1e-8;
relTol 0; relTol 0;
minIter 1;
} }
"Yi.*" "Yi.*"
{ {
solver smoothSolver; solver PBiCGStab;
smoother symGaussSeidel; preconditioner DILU;
tolerance 1e-6;
tolerance 1e-8;
relTol 0; relTol 0;
minIter 1;
} }
} }
PIMPLE PIMPLE
{ {
nOuterCorrectors 3; nOuterCorrectors 2;
nCorrectors 1; nCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
nEnergyCorrectors 2; nEnergyCorrectors 2;
faceMomentum yes; faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination yes;
} }
relaxationFactors relaxationFactors

View File

@ -83,7 +83,10 @@ PIMPLE
nEnergyCorrectors 1; nEnergyCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum yes; faceMomentum no;
VmDdtCorrection no;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -83,7 +83,10 @@ PIMPLE
nEnergyCorrectors 1; nEnergyCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
faceMomentum yes; faceMomentum no;
VmDdtCorrection no;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -73,8 +73,10 @@ PIMPLE
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
nEnergyCorrectors 1; nEnergyCorrectors 1;
faceMomentum yes; faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -82,8 +82,10 @@ PIMPLE
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
nEnergyCorrectors 1; nEnergyCorrectors 1;
faceMomentum yes; faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors

View File

@ -82,8 +82,10 @@ PIMPLE
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
nEnergyCorrectors 1; nEnergyCorrectors 1;
faceMomentum yes; faceMomentum no;
VmDdtCorrection yes;
dragCorrection yes;
partialElimination no;
} }
relaxationFactors relaxationFactors