mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
twoPhaseEulerFoam: Improved handling of velocity/flux boundary conditions
Updated tutorials to converge pressure during PIMPLE loop to avoid phase-fraction unboundedness which limits thermodynamics convergence.
This commit is contained in:
@ -30,6 +30,7 @@ volScalarField dragCoeff(fluid.dragCoeff());
|
||||
U1Eqn.relax();
|
||||
U1Eqn += fvm::Sp(dragCoeff, U1);
|
||||
fvOptions.constrain(U1Eqn);
|
||||
U1.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
{
|
||||
@ -52,5 +53,6 @@ volScalarField dragCoeff(fluid.dragCoeff());
|
||||
U2Eqn.relax();
|
||||
U2Eqn += fvm::Sp(dragCoeff, U2);
|
||||
fvOptions.constrain(U2Eqn);
|
||||
U2.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,6 +13,12 @@ while (pimple.correct())
|
||||
// Update continuity errors due to temperature changes
|
||||
#include "correctContErrs.H"
|
||||
|
||||
// Correct flux BCs to be consistent with the velocity BCs
|
||||
phi1.boundaryField() ==
|
||||
mrfZones.relative(mesh.Sf().boundaryField() & U1.boundaryField());
|
||||
phi2.boundaryField() ==
|
||||
mrfZones.relative(mesh.Sf().boundaryField() & U2.boundaryField());
|
||||
|
||||
volVectorField HbyA1
|
||||
(
|
||||
IOobject::groupName("HbyA", phase1.name()),
|
||||
@ -92,9 +98,9 @@ while (pimple.correct())
|
||||
surfaceScalarField phiCorrCoeff1(pos(alpha1fBar - 0.99));
|
||||
surfaceScalarField phiCorrCoeff2(pos(0.01 - alpha1fBar));
|
||||
|
||||
// Set ddtPhiCorr to 0 on non-coupled boundaries
|
||||
forAll(mesh.boundary(), patchi)
|
||||
{
|
||||
// Set ddtPhiCorr to 0 on non-coupled boundaries
|
||||
if
|
||||
(
|
||||
!mesh.boundary()[patchi].coupled()
|
||||
@ -272,18 +278,7 @@ while (pimple.correct())
|
||||
((phi1s + D1f*phi2s) - (phi2s + D2f*phi1s))/(1 - D1f*D2f)
|
||||
);
|
||||
|
||||
phi1.boundaryField() ==
|
||||
mrfZones.relative
|
||||
(
|
||||
mesh.Sf().boundaryField() & U1.boundaryField()
|
||||
);
|
||||
phi1 = phi + alpha2f*phir;
|
||||
|
||||
phi2.boundaryField() ==
|
||||
mrfZones.relative
|
||||
(
|
||||
mesh.Sf().boundaryField() & U2.boundaryField()
|
||||
);
|
||||
phi2 = phi - alpha1f*phir;
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ Description
|
||||
#include "IOMRFZoneList.H"
|
||||
#include "fvIOoptionList.H"
|
||||
#include "fixedFluxPressureFvPatchScalarField.H"
|
||||
#include "fixedValueFvsPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -60,13 +60,15 @@ Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel
|
||||
const blendingMethod& blending,
|
||||
const phasePair& pair,
|
||||
const orderedPhasePair& pair1In2,
|
||||
const orderedPhasePair& pair2In1
|
||||
const orderedPhasePair& pair2In1,
|
||||
const bool correctFixedFluxBCs
|
||||
)
|
||||
:
|
||||
pair_(pair),
|
||||
pair1In2_(pair1In2),
|
||||
pair2In1_(pair2In1),
|
||||
blending_(blending)
|
||||
blending_(blending),
|
||||
correctFixedFluxBCs_(correctFixedFluxBCs)
|
||||
{
|
||||
if (modelTable.found(pair_))
|
||||
{
|
||||
@ -161,7 +163,11 @@ Foam::BlendedInterfacialModel<modelType>::K() const
|
||||
x() += model2In1_->K()*f2;
|
||||
}
|
||||
|
||||
if (model_.valid() || model1In2_.valid() || model2In1_.valid())
|
||||
if
|
||||
(
|
||||
correctFixedFluxBCs_
|
||||
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
|
||||
)
|
||||
{
|
||||
correctFixedFluxBCs(x());
|
||||
}
|
||||
@ -217,7 +223,11 @@ Foam::BlendedInterfacialModel<modelType>::F() const
|
||||
x() -= model2In1_->F()*f2; // note : subtraction
|
||||
}
|
||||
|
||||
if (model_.valid() || model1In2_.valid() || model2In1_.valid())
|
||||
if
|
||||
(
|
||||
correctFixedFluxBCs_
|
||||
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
|
||||
)
|
||||
{
|
||||
correctFixedFluxBCs(x());
|
||||
}
|
||||
@ -272,7 +282,11 @@ Foam::BlendedInterfacialModel<modelType>::D() const
|
||||
x() += model2In1_->D()*f2;
|
||||
}
|
||||
|
||||
if (model_.valid() || model1In2_.valid() || model2In1_.valid())
|
||||
if
|
||||
(
|
||||
correctFixedFluxBCs_
|
||||
&& (model_.valid() || model1In2_.valid() || model2In1_.valid())
|
||||
)
|
||||
{
|
||||
correctFixedFluxBCs(x());
|
||||
}
|
||||
|
||||
@ -75,6 +75,9 @@ class BlendedInterfacialModel
|
||||
//- Blending model
|
||||
const blendingMethod& blending_;
|
||||
|
||||
//- If true set coefficients and forces to 0 at fixed-flux BCs
|
||||
bool correctFixedFluxBCs_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -103,7 +106,8 @@ public:
|
||||
const blendingMethod& blending,
|
||||
const phasePair& pair,
|
||||
const orderedPhasePair& pair1In2,
|
||||
const orderedPhasePair& pair2In1
|
||||
const orderedPhasePair& pair2In1,
|
||||
const bool correctFixedFluxBCs = true
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -184,7 +184,8 @@ Foam::twoPhaseSystem::twoPhaseSystem
|
||||
),
|
||||
pair_,
|
||||
pair1In2_,
|
||||
pair2In1_
|
||||
pair2In1_,
|
||||
false // Do not zero drag coefficent at fixed-flux BCs
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ boundaryField
|
||||
{
|
||||
type inletOutlet;
|
||||
phi phi.water;
|
||||
inletValue uniform 300;
|
||||
inletValue $internalField;
|
||||
value $internalField;
|
||||
}
|
||||
inlet
|
||||
|
||||
@ -35,7 +35,7 @@ solvers
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
tolerance 1e-8;
|
||||
relTol 0.01;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
|
||||
@ -28,7 +28,7 @@ boundaryField
|
||||
{
|
||||
type inletOutlet;
|
||||
phi phi.water;
|
||||
inletValue uniform 300;
|
||||
inletValue $internalField;
|
||||
value $internalField;
|
||||
}
|
||||
inlet
|
||||
|
||||
@ -35,7 +35,7 @@ solvers
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
tolerance 1e-8;
|
||||
relTol 0.01;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
|
||||
@ -42,7 +42,7 @@ solvers
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
tolerance 1e-8;
|
||||
relTol 0.01;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
|
||||
@ -28,7 +28,7 @@ boundaryField
|
||||
{
|
||||
type inletOutlet;
|
||||
phi phi.water;
|
||||
inletValue uniform 300;
|
||||
inletValue $internalField;
|
||||
value $internalField;
|
||||
}
|
||||
inlet
|
||||
|
||||
@ -35,7 +35,7 @@ solvers
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
tolerance 1e-8;
|
||||
relTol 0.01;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
|
||||
@ -28,7 +28,7 @@ boundaryField
|
||||
{
|
||||
type inletOutlet;
|
||||
phi phi.water;
|
||||
inletValue uniform 300;
|
||||
inletValue $internalField;
|
||||
value $internalField;
|
||||
}
|
||||
inlet
|
||||
|
||||
@ -35,7 +35,7 @@ solvers
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
tolerance 1e-8;
|
||||
relTol 0.01;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
|
||||
@ -42,7 +42,7 @@ solvers
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
tolerance 1e-8;
|
||||
relTol 0.01;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
|
||||
@ -23,7 +23,7 @@ injector1
|
||||
selectionMode points;
|
||||
points
|
||||
(
|
||||
(0.075 0.1 0.05)
|
||||
(0.075 0.2 0.05)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ solvers
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
tolerance 1e-8;
|
||||
relTol 0.01;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
|
||||
@ -25,8 +25,11 @@ solvers
|
||||
|
||||
p_rgh
|
||||
{
|
||||
solver GAMG;
|
||||
smoother DIC;
|
||||
solver PCG;
|
||||
preconditioner
|
||||
{
|
||||
preconditioner GAMG;
|
||||
smoother GaussSeidel;
|
||||
nPreSweeps 0;
|
||||
nPostSweeps 2;
|
||||
nFinestSweeps 2;
|
||||
@ -34,8 +37,9 @@ solvers
|
||||
nCellsInCoarsestLevel 10;
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
tolerance 1e-7;
|
||||
relTol 0.01;
|
||||
}
|
||||
tolerance 1e-6;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
|
||||
Reference in New Issue
Block a user