diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H index 1cee6d04813f97b465ea4f76c345d7387a2b40bd..6c765ec66b9235efced56355b7b3047732ef7f45 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H @@ -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(); } } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H index 0924c5d178c86852322b55870127a939bd1e1da8..b0a5ae9e7ceb73bb0e2ae9af666a8768a8ce1e6a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pEqn.H @@ -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; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C index f9effa437ba8482ba82094b3838a75b0544dc1f0..f518de617788a83b83cdd8eb1323ba07b98633b7 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C @@ -37,6 +37,7 @@ Description #include "IOMRFZoneList.H" #include "fvIOoptionList.H" #include "fixedFluxPressureFvPatchScalarField.H" +#include "fixedValueFvsPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C index a41165d8ee9c203b9780e973201093000b60645b..93d9bb4c78b06eb902763d011e246dd1c514c604 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -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()); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H index aa3bb3df2e0110a35b4a872aad197fcbff7bffa5..f56ab025b665ab84b789d92879d748256b1671d2 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H @@ -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 ); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index d7a58a380964ec3567698c35ebf872ef606ff69e..32ca0ace850cc3a3f0c0dd5a92da79e9486e201c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -184,7 +184,8 @@ Foam::twoPhaseSystem::twoPhaseSystem ), pair_, pair1In2_, - pair2In1_ + pair2In1_, + false // Do not zero drag coefficent at fixed-flux BCs ) ); diff --git a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/0/T.water b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/0/T.water index d19f29f191e26f0ed29879b4f5b59c72218bcd9b..3c62df75d0c74e8881ad13181e97f7757382d0bf 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/0/T.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/0/T.water @@ -28,7 +28,7 @@ boundaryField { type inletOutlet; phi phi.water; - inletValue uniform 300; + inletValue $internalField; value $internalField; } inlet diff --git a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/system/fvSolution b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/system/fvSolution index 1e0e5d0f07ba546fea0039cd64b1cb167b7e6d2a..de1aecacf9335bb46447421cd5a486c4b85d685d 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/system/fvSolution @@ -35,7 +35,7 @@ solvers agglomerator faceAreaPair; mergeLevels 1; tolerance 1e-8; - relTol 0.01; + relTol 0; } p_rghFinal diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/0/T.water b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/0/T.water index d19f29f191e26f0ed29879b4f5b59c72218bcd9b..3c62df75d0c74e8881ad13181e97f7757382d0bf 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/0/T.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/0/T.water @@ -28,7 +28,7 @@ boundaryField { type inletOutlet; phi phi.water; - inletValue uniform 300; + inletValue $internalField; value $internalField; } inlet diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/fvSolution b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/fvSolution index 9868241ad9985ecad147c97118919a84536b1ced..f6f72076f0b473028b810467e708c8e0ba79002f 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/fvSolution @@ -35,7 +35,7 @@ solvers agglomerator faceAreaPair; mergeLevels 1; tolerance 1e-8; - relTol 0.01; + relTol 0; } p_rghFinal diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/system/fvSolution b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/system/fvSolution index 0328d987376fdbb0593d5ea4bc87737efca4fa65..49d9bfea716d8ed7152efe75d4ab5f0f49afc698 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/system/fvSolution +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/system/fvSolution @@ -42,7 +42,7 @@ solvers agglomerator faceAreaPair; mergeLevels 1; tolerance 1e-8; - relTol 0.01; + relTol 0; } p_rghFinal diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/0/T.water b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/0/T.water index 1cfd38f926516878085292090cf2e55699fef0cb..e592c501d54f0421cc5df1b3ed3954cfb6969b1d 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/0/T.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/0/T.water @@ -28,7 +28,7 @@ boundaryField { type inletOutlet; phi phi.water; - inletValue uniform 300; + inletValue $internalField; value $internalField; } inlet diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution index 6487d35276d6bdb3ef9b921b36962e74f482cfa9..350b0c0c1fe42f2d87699003d0b6b2532edda2ed 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/fvSolution @@ -35,7 +35,7 @@ solvers agglomerator faceAreaPair; mergeLevels 1; tolerance 1e-8; - relTol 0.01; + relTol 0; } p_rghFinal diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/0/T.water b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/0/T.water index d19f29f191e26f0ed29879b4f5b59c72218bcd9b..3c62df75d0c74e8881ad13181e97f7757382d0bf 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/0/T.water +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/0/T.water @@ -28,7 +28,7 @@ boundaryField { type inletOutlet; phi phi.water; - inletValue uniform 300; + inletValue $internalField; value $internalField; } inlet diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution index 171537ad3172756755c138b73845168d27b50805..28572b1e0aefc79064d947cce60c25927caca654 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution @@ -35,7 +35,7 @@ solvers agglomerator faceAreaPair; mergeLevels 1; tolerance 1e-8; - relTol 0.01; + relTol 0; } p_rghFinal diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/system/fvSolution b/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/system/fvSolution index 5ca69b0fcd987d96dfd3ebaa7b9c8dda37952b09..d5d97565bd238a59bc572d372e906349763d2b8f 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/system/fvSolution +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/system/fvSolution @@ -42,7 +42,7 @@ solvers agglomerator faceAreaPair; mergeLevels 1; tolerance 1e-8; - relTol 0.01; + relTol 0; } p_rghFinal diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/constant/fvOptions b/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/constant/fvOptions index 5bcb5c0dbb1006a06c875e2ac8ac8bf70421fad6..f231c3d6054f4ace950881b5deb4fcbb04189537 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/constant/fvOptions +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/constant/fvOptions @@ -23,7 +23,7 @@ injector1 selectionMode points; points ( - (0.075 0.1 0.05) + (0.075 0.2 0.05) ); } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/system/fvSolution b/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/system/fvSolution index 6487d35276d6bdb3ef9b921b36962e74f482cfa9..350b0c0c1fe42f2d87699003d0b6b2532edda2ed 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/system/fvSolution +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/system/fvSolution @@ -35,7 +35,7 @@ solvers agglomerator faceAreaPair; mergeLevels 1; tolerance 1e-8; - relTol 0.01; + relTol 0; } p_rghFinal diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution index 59c0cbf3ab2e0bddacfb803daf62b94c6f9629ca..a95a952401d428b3c8a83b229763258d70aff7dc 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/fvSolution @@ -25,17 +25,21 @@ solvers p_rgh { - solver GAMG; - smoother DIC; - nPreSweeps 0; - nPostSweeps 2; - nFinestSweeps 2; - cacheAgglomeration true; - nCellsInCoarsestLevel 10; - agglomerator faceAreaPair; - mergeLevels 1; - tolerance 1e-7; - relTol 0.01; + solver PCG; + preconditioner + { + preconditioner GAMG; + smoother GaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + tolerance 1e-6; + relTol 0; } p_rghFinal