From ab7d010a9aa91576a93ed7b09bb0f4e607a0fbd8 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 27 Apr 2021 10:25:28 +0100 Subject: [PATCH] fvConstraints: Added limitPressure which replaces pressureControl.limit To provide more flexibility, extensibility, run-time modifiability and consistency the handling of optional pressure limits has been moved from pressureControl (settings in system/fvSolution) to the new limitPressure fvConstraint (settings in system/fvConstraints). All tutorials have been updated which provides guidance when upgrading cases but also helpful error messages are generated for cases using the old settings providing specific details as to how the case should be updated, e.g. for the tutorials/compressible/rhoSimpleFoam/squareBend case which has the pressure limit specification: SIMPLE { ... pMinFactor 0.1; pMaxFactor 2; ... generates the error message --> FOAM FATAL IO ERROR: Pressure limits should now be specified in fvConstraints: limitp { type limitPressure; minFactor 0.1; maxFactor 2; } file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution/SIMPLE from line 41 to line 54. --- .../buoyantReactingFoam/buoyantReactingFoam.C | 2 +- .../buoyantReactingFoam/createFields.H | 2 +- .../combustion/reactingFoam/createFields.H | 2 +- .../combustion/reactingFoam/reactingFoam.C | 2 +- .../compressible/rhoPimpleFoam/createFields.H | 2 +- .../solvers/compressible/rhoPimpleFoam/pEqn.H | 14 +- .../rhoPimpleFoam/rhoPimpleFoam.C | 2 +- .../compressible/rhoSimpleFoam/createFields.H | 2 +- .../solvers/compressible/rhoSimpleFoam/pEqn.H | 10 +- .../rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H | 6 +- .../rhoPorousSimpleFoam/rhoPorousSimpleFoam.C | 2 +- .../rhoSimpleFoam/rhoSimpleFoam.C | 2 +- .../buoyantPimpleFoam/buoyantPimpleFoam.C | 2 +- .../buoyantPimpleFoam/createFields.H | 2 +- .../heatTransfer/buoyantPimpleFoam/pEqn.H | 14 +- .../buoyantSimpleFoam/buoyantSimpleFoam.C | 2 +- .../buoyantSimpleFoam/createFields.H | 2 +- .../heatTransfer/buoyantSimpleFoam/pEqn.H | 10 +- .../chtMultiRegionFoam/chtMultiRegionFoam.C | 2 +- .../fluid/createFluidPressureControls.H | 6 +- .../fluid/setRegionFluidFields.H | 2 +- .../buoyantReactingParticleFoam.C | 2 +- .../createFields.H | 2 +- .../buoyantReactingParticleFoam/pEqn.H | 6 +- .../reactingParticleFoam/createFields.H | 2 +- .../engineFoam/engineFoam.C | 2 +- .../lagrangian/reactingParticleFoam/pEqn.H | 4 +- .../reactingParticleFoam.C | 2 +- .../multiphaseEulerFoam/createFields.H | 7 +- .../multiphaseEulerFoam/multiphaseEulerFoam.C | 2 +- .../multiphaseEulerFoam/pU/pEqn.H | 10 +- .../multiphaseEulerFoam/pUf/pEqn.H | 10 +- src/finiteVolume/Make/files | 2 +- .../general/fvConstraints/fvConstraint.C | 12 +- .../general/fvConstraints/fvConstraint.H | 4 +- .../general/fvConstraints/fvConstraintM.H | 12 +- .../general/fvConstraints/fvConstraints.H | 4 +- .../fvConstraints/fvConstraintsTemplates.C | 18 +- .../general/pressureControl/pressureControl.C | 285 ------------------ .../pressureReference/pressureReference.C | 124 ++++++++ .../pressureReference.H} | 39 +-- .../pressureReferenceI.H} | 6 +- src/fvConstraints/Make/files | 1 + .../fixedTemperatureConstraint.C | 4 +- .../fixedTemperatureConstraint.H | 2 +- .../fixedValueConstraint.C | 4 +- .../fixedValueConstraint.H | 2 +- .../limitPressure/limitPressure.C | 222 ++++++++++++++ .../limitPressure/limitPressure.H | 143 +++++++++ .../limitTemperature/limitTemperature.C | 4 +- .../limitTemperature/limitTemperature.H | 2 +- .../limitVelocity/limitVelocity.C | 4 +- .../limitVelocity/limitVelocity.H | 2 +- .../meanVelocityForce/meanVelocityForce.C | 8 +- .../meanVelocityForce/meanVelocityForce.H | 4 +- .../LES/pitzDaily/system/fvConstraints | 25 ++ .../LES/pitzDaily/system/fvSolution | 3 - .../RAS/aerofoilNACA0012/system/fvConstraints | 10 + .../RAS/aerofoilNACA0012/system/fvSolution | 4 - .../RAS/angledDuct/system/fvConstraints | 25 ++ .../RAS/angledDuct/system/fvSolution | 3 - .../RAS/angledDuctLTS/system/fvConstraints | 25 ++ .../RAS/angledDuctLTS/system/fvSolution | 3 - .../annularThermalMixer/system/fvConstraints | 25 ++ .../RAS/annularThermalMixer/system/fvSolution | 3 - .../RAS/cavity/system/fvConstraints | 25 ++ .../RAS/cavity/system/fvSolution | 3 - .../RAS/mixerVessel2D/system/fvConstraints | 25 ++ .../RAS/mixerVessel2D/system/fvSolution | 3 - .../RAS/squareBendLiq/system/fvConstraints | 25 ++ .../RAS/squareBendLiq/system/fvSolution | 2 - .../helmholtzResonance/system/fvConstraints | 25 ++ .../helmholtzResonance/system/fvSolution | 3 - .../angledDuctExplicit/system/fvConstraints | 25 ++ .../angledDuctExplicit/system/fvSolution | 2 - .../angledDuctImplicit/system/fvConstraints | 8 + .../angledDuctImplicit/system/fvSolution | 2 - .../aerofoilNACA0012/system/fvConstraints | 10 +- .../aerofoilNACA0012/system/fvSolution | 2 - .../system/fvConstraints | 8 + .../system/fvSolution | 2 - .../squareBend/system/fvConstraints | 25 ++ .../squareBend/system/fvSolution | 2 - .../squareBendLiq/system/fvConstraints | 25 ++ .../squareBendLiq/system/fvSolution | 2 - .../verticalChannel/system/fvConstraints | 25 ++ .../verticalChannel/system/fvSolution | 3 - .../verticalChannelLTS/system/fvConstraints | 25 ++ .../verticalChannelLTS/system/fvSolution | 3 - .../LES/bubbleColumn/system/fvConstraints | 24 ++ .../LES/bubbleColumn/system/fvSolution | 2 - .../RAS/Grossetete/system/fvConstraints | 24 ++ .../RAS/Grossetete/system/fvSolution | 2 - .../RAS/LBend/system/fvConstraints | 24 ++ .../RAS/LBend/system/fvSolution | 1 - .../RAS/bubbleColumn/system/fvConstraints | 24 ++ .../RAS/bubbleColumn/system/fvSolution | 1 - .../system/fvConstraints | 24 ++ .../system/fvSolution | 1 - .../RAS/bubblePipe/system/fvConstraints | 24 ++ .../RAS/bubblePipe/system/fvSolution | 1 - .../RAS/fluidisedBed/system/fvConstraints | 24 ++ .../RAS/fluidisedBed/system/fvSolution | 1 - .../RAS/wallBoiling/system/fvConstraints | 24 ++ .../RAS/wallBoiling/system/fvSolution | 1 - .../RAS/wallBoilingIATE/system/fvConstraints | 24 ++ .../RAS/wallBoilingIATE/system/fvSolution | 1 - .../system/fvConstraints | 24 ++ .../wallBoilingPolydisperse/system/fvSolution | 1 - .../system/fvConstraints | 24 ++ .../system/fvSolution | 1 - .../laminar/bed/system/fvConstraints | 24 ++ .../laminar/bed/system/fvSolution | 1 - .../laminar/bubbleColumn/system/fvConstraints | 24 ++ .../laminar/bubbleColumn/system/fvSolution | 1 - .../system/fvConstraints | 24 ++ .../bubbleColumnEvaporating/system/fvSolution | 1 - .../system/fvConstraints | 24 ++ .../system/fvSolution | 1 - .../bubbleColumnIATE/system/fvConstraints | 24 ++ .../bubbleColumnIATE/system/fvSolution | 1 - .../damBreak4phase/system/fvConstraints | 24 ++ .../laminar/damBreak4phase/system/fvSolution | 1 - .../laminar/fluidisedBed/system/fvConstraints | 24 ++ .../laminar/fluidisedBed/system/fvSolution | 1 - .../laminar/injection/system/fvConstraints | 24 ++ .../laminar/injection/system/fvSolution | 1 - .../laminar/mixerVesselAMI2D/0/alpha.map | 55 ++++ .../steamInjection/system/fvConstraints | 8 +- .../laminar/steamInjection/system/fvSolution | 2 - .../titaniaSynthesis/system/fvConstraints | 24 ++ .../titaniaSynthesis/system/fvSolution | 1 - .../system/fvConstraints | 24 ++ .../titaniaSynthesisSurface/system/fvSolution | 1 - .../laminar/trickleBed/system/fvConstraints | 24 ++ .../laminar/trickleBed/system/fvSolution | 1 - 136 files changed, 1580 insertions(+), 490 deletions(-) delete mode 100644 src/finiteVolume/cfdTools/general/pressureControl/pressureControl.C create mode 100644 src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C rename src/finiteVolume/cfdTools/general/{pressureControl/pressureControl.H => pressureReference/pressureReference.H} (78%) rename src/finiteVolume/cfdTools/general/{pressureControl/pressureControlI.H => pressureReference/pressureReferenceI.H} (87%) create mode 100644 src/fvConstraints/limitPressure/limitPressure.C create mode 100644 src/fvConstraints/limitPressure/limitPressure.H create mode 100644 tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/fvConstraints create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/fvConstraints create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/fvConstraints create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/fvConstraints create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/fvConstraints create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/fvConstraints create mode 100644 tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvConstraints create mode 100644 tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/fvConstraints create mode 100644 tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvConstraints create mode 100644 tutorials/compressible/rhoSimpleFoam/squareBend/system/fvConstraints create mode 100644 tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvConstraints create mode 100644 tutorials/lagrangian/reactingParticleFoam/verticalChannel/system/fvConstraints create mode 100644 tutorials/lagrangian/reactingParticleFoam/verticalChannelLTS/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/LES/bubbleColumn/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/LBend/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumn/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/fluidisedBed/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/bed/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumn/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnIATE/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/damBreak4phase/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/fluidisedBed/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/injection/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVesselAMI2D/0/alpha.map create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/fvConstraints create mode 100644 tutorials/multiphase/multiphaseEulerFoam/laminar/trickleBed/system/fvConstraints diff --git a/applications/solvers/combustion/reactingFoam/buoyantReactingFoam/buoyantReactingFoam.C b/applications/solvers/combustion/reactingFoam/buoyantReactingFoam/buoyantReactingFoam.C index ac88c878b6..470b5dbfa7 100644 --- a/applications/solvers/combustion/reactingFoam/buoyantReactingFoam/buoyantReactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/buoyantReactingFoam/buoyantReactingFoam.C @@ -37,7 +37,7 @@ Description #include "fluidReactionThermophysicalTransportModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "fvModels.H" #include "fvConstraints.H" #include "localEulerDdtScheme.H" diff --git a/applications/solvers/combustion/reactingFoam/buoyantReactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/buoyantReactingFoam/createFields.H index f914969741..0b210962b4 100644 --- a/applications/solvers/combustion/reactingFoam/buoyantReactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/buoyantReactingFoam/createFields.H @@ -92,7 +92,7 @@ volScalarField p_rgh // Force p_rgh to be consistent with p p_rgh = p - rho*gh - pRef; -pressureControl pressureControl +pressureReference pressureReference ( p, p_rgh, diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index d52985dc66..9476ebb7fc 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -38,7 +38,7 @@ volScalarField& p = thermo.p(); #include "compressibleCreatePhi.H" -pressureControl pressureControl(p, rho, pimple.dict(), false); +pressureReference pressureReference(p, rho, pimple.dict(), false); mesh.setFluxRequired(p.name()); diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index 9048c9d697..d32acf5af9 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -37,7 +37,7 @@ Description #include "fluidReactionThermophysicalTransportModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "CorrectPhi.H" #include "fvModels.H" #include "fvConstraints.H" diff --git a/applications/solvers/compressible/rhoPimpleFoam/createFields.H b/applications/solvers/compressible/rhoPimpleFoam/createFields.H index df5da2eb11..2e1caaf28e 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPimpleFoam/createFields.H @@ -40,7 +40,7 @@ volVectorField U #include "compressibleCreatePhi.H" -pressureControl pressureControl +pressureReference pressureReference ( p, rho, diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index a68c68ee47..ae356931b0 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -82,8 +82,8 @@ if (pimple.transonic()) pEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); pEqn.solve(); @@ -121,8 +121,8 @@ else pEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); pEqn.solve(); @@ -140,12 +140,12 @@ if (mesh.steady()) } else { - const bool limitedp = pressureControl.limit(p); + const bool constrained = fvConstraints.constrain(p); // Thermodynamic density update thermo.correctRho(psi*p - psip0); - if (limitedp) + if (constrained) { rho = thermo.rho(); } @@ -164,7 +164,7 @@ K = 0.5*magSqr(U); if (mesh.steady()) { - pressureControl.limit(p); + fvConstraints.constrain(p); } // For steady compressible closed-volume cases adjust the pressure level diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index cad6df4039..06d2f97bc2 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -39,7 +39,7 @@ Description #include "dynamicMomentumTransportModel.H" #include "fluidThermophysicalTransportModel.H" #include "pimpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "CorrectPhi.H" #include "fvModels.H" #include "fvConstraints.H" diff --git a/applications/solvers/compressible/rhoSimpleFoam/createFields.H b/applications/solvers/compressible/rhoSimpleFoam/createFields.H index ec2c56de3c..62bd6f2049 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoSimpleFoam/createFields.H @@ -38,7 +38,7 @@ volVectorField U #include "compressibleCreatePhi.H" -pressureControl pressureControl +pressureReference pressureReference ( p, rho, diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 51c51695c8..3659ac444f 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -72,8 +72,8 @@ if (simple.transonic()) pEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); pEqn.solve(); @@ -106,8 +106,8 @@ else pEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); pEqn.solve(); @@ -128,7 +128,7 @@ U = HbyA - rAAtU*fvc::grad(p); U.correctBoundaryConditions(); fvConstraints.constrain(U); -pressureControl.limit(p); +fvConstraints.constrain(p); // For closed-volume cases adjust the pressure and density levels // to obey overall mass continuity diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H index d0753fd4f6..71e27f12ba 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/pEqn.H @@ -54,8 +54,8 @@ pEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); pEqn.solve(); @@ -83,7 +83,7 @@ U.correctBoundaryConditions(); fvConstraints.constrain(U); - pressureControl.limit(p); + fvConstraints.constrain(p); // For closed-volume cases adjust the pressure and density levels // to obey overall mass continuity diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C index 0aa727afa8..f6ba62632e 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousSimpleFoam/rhoPorousSimpleFoam.C @@ -35,7 +35,7 @@ Description #include "dynamicMomentumTransportModel.H" #include "fluidThermophysicalTransportModel.H" #include "simpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "fvModels.H" #include "fvConstraints.H" #include "IOporosityModelList.H" diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C index 3b2384fd32..6d0af5d6a9 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C @@ -34,7 +34,7 @@ Description #include "dynamicMomentumTransportModel.H" #include "fluidThermophysicalTransportModel.H" #include "simpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "fvModels.H" #include "fvConstraints.H" diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C index 45591737ae..e45bcaa51b 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C @@ -40,7 +40,7 @@ Description #include "dynamicMomentumTransportModel.H" #include "fluidThermophysicalTransportModel.H" #include "pimpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "CorrectPhi.H" #include "fvModels.H" #include "fvConstraints.H" diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H index 1b2f39a67b..39507b344b 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H @@ -79,7 +79,7 @@ volScalarField p_rgh // Force p_rgh to be consistent with p p_rgh = p - rho*gh - pRef; -pressureControl pressureControl +pressureReference pressureReference ( p, p_rgh, diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index 625a170e81..a3cddc05d8 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -65,8 +65,8 @@ if (pimple.transonic()) p_rghEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); p_rghEqn.solve(); @@ -88,8 +88,8 @@ else p_rghEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); p_rghEqn.solve(); @@ -106,12 +106,12 @@ if (mesh.steady()) } else { - const bool limitedp = pressureControl.limit(p); + const bool constrained = fvConstraints.constrain(p); // Thermodynamic density update thermo.correctRho(psi*p - psip0); - if (limitedp) + if (constrained) { rho = thermo.rho(); } @@ -132,7 +132,7 @@ K = 0.5*magSqr(U); if (mesh.steady()) { - pressureControl.limit(p); + fvConstraints.constrain(p); } // For steady closed-volume compressible cases adjust the pressure level diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index f796aa1b50..a5d7f26838 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -34,7 +34,7 @@ Description #include "dynamicMomentumTransportModel.H" #include "fluidThermophysicalTransportModel.H" #include "simpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "fvModels.H" #include "fvConstraints.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H index 57f56131b4..72b560e735 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H @@ -77,7 +77,7 @@ volScalarField p_rgh // Force p_rgh to be consistent with p p_rgh = p - rho*gh - pRef; -pressureControl pressureControl +pressureReference pressureReference ( p, p_rgh, diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 2a40092b37..8a37080900 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -48,8 +48,8 @@ if (simple.transonic()) p_rghEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); p_rghEqn.solve(); @@ -67,8 +67,8 @@ else p_rghEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); p_rghEqn.solve(); @@ -90,7 +90,7 @@ U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf); U.correctBoundaryConditions(); fvConstraints.constrain(U); -pressureControl.limit(p); +fvConstraints.constrain(p); // For closed-volume compressible cases adjust the pressure level // to obey overall mass continuity diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index 007aad8d11..042858933e 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -45,7 +45,7 @@ Description #include "fvConstraints.H" #include "coordinateSystem.H" #include "pimpleMultiRegionControl.H" -#include "pressureControl.H" +#include "pressureReference.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidPressureControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidPressureControls.H index 0134fd3582..2a63529163 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidPressureControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidPressureControls.H @@ -1,11 +1,11 @@ -PtrList pressureControlFluid(fluidRegions.size()); +PtrList pressureReferenceFluid(fluidRegions.size()); forAll(fluidRegions, i) { - pressureControlFluid.set + pressureReferenceFluid.set ( i, - new pressureControl + new pressureReference ( p_rghFluid[i], rhoFluid[i], diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H index b8e5d41b27..7a2d5ff48c 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setRegionFluidFields.H @@ -47,7 +47,7 @@ pimpleNoLoopControl& pimple = pimples.pimple(i); - pressureControl& pressureControl = pressureControlFluid[i]; + pressureReference& pressureReference = pressureReferenceFluid[i]; scalar cumulativeContErr = cumulativeContErrs[i]; diff --git a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/buoyantReactingParticleFoam.C b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/buoyantReactingParticleFoam.C index 7cc72ef8dd..cce0d1029d 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/buoyantReactingParticleFoam.C +++ b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/buoyantReactingParticleFoam.C @@ -41,7 +41,7 @@ Description #include "fvModels.H" #include "fvConstraints.H" #include "pimpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "CorrectPhi.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/createFields.H b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/createFields.H index ead5fc3e5f..971038ff3d 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/createFields.H @@ -105,7 +105,7 @@ volScalarField p_rgh // Force p_rgh to be consistent with p p_rgh = p - rho*gh; -pressureControl pressureControl +pressureReference pressureReference ( p, p_rgh, diff --git a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/pEqn.H b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/pEqn.H index 8e1477d345..9e05a3682e 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/pEqn.H @@ -64,9 +64,9 @@ while (pimple.correctNonOrthogonal()) p = p_rgh + rho*gh; -bool limitedp = pressureControl.limit(p); +bool constrained = fvConstraints.constrain(p); -if (limitedp) +if (constrained) { p_rgh = p - rho*gh; } @@ -74,7 +74,7 @@ if (limitedp) // Thermodynamic density update thermo.correctRho(psi*p - psip0); -if (limitedp) +if (constrained) { rho = thermo.rho(); } diff --git a/applications/solvers/lagrangian/reactingParticleFoam/createFields.H b/applications/solvers/lagrangian/reactingParticleFoam/createFields.H index 771c74568a..f869dff8e2 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParticleFoam/createFields.H @@ -87,7 +87,7 @@ volScalarField K("K", 0.5*magSqr(U)); #include "readGravitationalAcceleration.H" -pressureControl pressureControl +pressureReference pressureReference ( p, rho, diff --git a/applications/solvers/lagrangian/reactingParticleFoam/engineFoam/engineFoam.C b/applications/solvers/lagrangian/reactingParticleFoam/engineFoam/engineFoam.C index 587a795ea8..1a95a0f692 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/engineFoam/engineFoam.C +++ b/applications/solvers/lagrangian/reactingParticleFoam/engineFoam/engineFoam.C @@ -41,7 +41,7 @@ Description #include "fvModels.H" #include "fvConstraints.H" #include "pimpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "CorrectPhi.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/lagrangian/reactingParticleFoam/pEqn.H b/applications/solvers/lagrangian/reactingParticleFoam/pEqn.H index 3d7c7ccb50..f251cae96a 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParticleFoam/pEqn.H @@ -58,12 +58,12 @@ U.correctBoundaryConditions(); fvConstraints.constrain(U); K = 0.5*magSqr(U); -bool limitedp = pressureControl.limit(p); +bool constrained = fvConstraints.constrain(p); // Thermodynamic density update thermo.correctRho(psi*p - psip0); -if (limitedp) +if (constrained) { rho = thermo.rho(); } diff --git a/applications/solvers/lagrangian/reactingParticleFoam/reactingParticleFoam.C b/applications/solvers/lagrangian/reactingParticleFoam/reactingParticleFoam.C index 57c162dbaf..0ee97a2f1b 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/reactingParticleFoam.C +++ b/applications/solvers/lagrangian/reactingParticleFoam/reactingParticleFoam.C @@ -41,7 +41,7 @@ Description #include "fvModels.H" #include "fvConstraints.H" #include "pimpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "CorrectPhi.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFields.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFields.H index b1092e78e4..b9d713f752 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/createFields.H @@ -36,7 +36,7 @@ if (fluid.found("pMin")) << pimple.dict().name() << endl; } -pressureControl pressureControl +pressureReference pressureReference ( p, p_rgh, @@ -48,7 +48,6 @@ pressureControl pressureControl if (fluid.incompressible()) { p = p_rgh + fluid.rho()*gh; - pressureControl.limit(p); } if (p_rgh.needReference() && fluid.incompressible()) @@ -57,8 +56,8 @@ if (p_rgh.needReference() && fluid.incompressible()) ( "p", p.dimensions(), - pressureControl.refValue() - - getRefCellValue(p, pressureControl.refCell()) + pressureReference.refValue() + - getRefCellValue(p, pressureReference.refCell()) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseEulerFoam.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseEulerFoam.C index c2c48e9a50..888ab0c075 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseEulerFoam.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/multiphaseEulerFoam.C @@ -38,7 +38,7 @@ Description #include "phaseSystem.H" #include "phaseDynamicMomentumTransportModel.H" #include "pimpleControl.H" -#include "pressureControl.H" +#include "pressureReference.H" #include "localEulerDdtScheme.H" #include "fvcSmooth.H" diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/pU/pEqn.H index 79b7846e70..34ee2caf3a 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/pU/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/pU/pEqn.H @@ -259,8 +259,8 @@ while (pimple.correct()) { pEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); } @@ -332,7 +332,7 @@ while (pimple.correct()) // Update and limit the static pressure p = p_rgh + rho*gh; - pressureControl.limit(p); + fvConstraints.constrain(p); // Account for static pressure reference if (p_rgh.needReference() && fluid.incompressible()) @@ -341,8 +341,8 @@ while (pimple.correct()) ( "p", p.dimensions(), - pressureControl.refValue() - - getRefCellValue(p, pressureControl.refCell()) + pressureReference.refValue() + - getRefCellValue(p, pressureReference.refCell()) ); } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/pUf/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/pUf/pEqn.H index 4caed5bc8e..100da22406 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/pUf/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam/pUf/pEqn.H @@ -250,8 +250,8 @@ while (pimple.correct()) { pEqn.setReference ( - pressureControl.refCell(), - pressureControl.refValue() + pressureReference.refCell(), + pressureReference.refValue() ); } @@ -310,7 +310,7 @@ while (pimple.correct()) // Update and limit the static pressure p = p_rgh + rho*gh; - pressureControl.limit(p); + fvConstraints.constrain(p); // Account for static pressure reference if (p_rgh.needReference() && fluid.incompressible()) @@ -319,8 +319,8 @@ while (pimple.correct()) ( "p", p.dimensions(), - pressureControl.refValue() - - getRefCellValue(p, pressureControl.refCell()) + pressureReference.refValue() + - getRefCellValue(p, pressureReference.refCell()) ); } diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 5ab6d19d91..295c084b77 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -408,7 +408,7 @@ $(general)/constrainHbyA/constrainHbyA.C $(general)/adjustPhi/adjustPhi.C $(general)/bound/bound.C $(general)/CorrectPhi/correctUphiBCs.C -$(general)/pressureControl/pressureControl.C +$(general)/pressureReference/pressureReference.C $(general)/levelSet/levelSet.C solutionControl = $(general)/solutionControl diff --git a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraint.C b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraint.C index 98d5a73434..1285ee1df9 100644 --- a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraint.C +++ b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraint.C @@ -38,17 +38,21 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -void Foam::fvConstraint::constrainType +bool Foam::fvConstraint::constrainType ( fvMatrix& eqn, const word& fieldName ) const -{} +{ + return false; +} template -void Foam::fvConstraint::constrainType(VolField& field) const -{} +bool Foam::fvConstraint::constrainType(VolField& field) const +{ + return false; +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraint.H b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraint.H index a1dfabd5b3..1e7212bbc1 100644 --- a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraint.H +++ b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraint.H @@ -76,7 +76,7 @@ class fvConstraint //- Apply a constraint to an equation template - void constrainType + bool constrainType ( fvMatrix& eqn, const word& fieldName @@ -84,7 +84,7 @@ class fvConstraint //- Apply constraint to a field template - void constrainType(VolField& field) const; + bool constrainType(VolField& field) const; public: diff --git a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraintM.H b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraintM.H index dde2de657d..dc7ee96476 100644 --- a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraintM.H +++ b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraintM.H @@ -24,32 +24,32 @@ License \*---------------------------------------------------------------------------*/ #define DEFINE_FV_CONSTRAINT_CONSTRAIN(Type, nullArg) \ - virtual void constrain \ + virtual bool constrain \ ( \ fvMatrix& eqn, \ const word& fieldName \ ) const; #define IMPLEMENT_FV_CONSTRAINT_CONSTRAIN(Type, constraintType) \ - void Foam::constraintType::constrain \ + bool Foam::constraintType::constrain \ ( \ fvMatrix& eqn, \ const word& fieldName \ ) const \ { \ - constrainType(eqn, fieldName); \ + return constrainType(eqn, fieldName); \ } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #define DEFINE_FV_CONSTRAINT_CONSTRAIN_FIELD(Type, nullArg) \ - virtual void constrain(VolField& field) const; + virtual bool constrain(VolField& field) const; #define IMPLEMENT_FV_CONSTRAINT_CONSTRAIN_FIELD(Type, constraintType) \ - void Foam::constraintType::constrain(VolField& field) const \ + bool Foam::constraintType::constrain(VolField& field) const \ { \ - constrainType(field); \ + return constrainType(field); \ } diff --git a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.H b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.H index 0770791229..75bccf7215 100644 --- a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.H +++ b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.H @@ -128,11 +128,11 @@ public: //- Apply constraints to an equation template - void constrain(fvMatrix& eqn) const; + bool constrain(fvMatrix& eqn) const; //- Apply constraints to a field template - void constrain + bool constrain ( GeometricField& field ) const; diff --git a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraintsTemplates.C b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraintsTemplates.C index 75ed2d8fda..35ff93cf47 100644 --- a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraintsTemplates.C +++ b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraintsTemplates.C @@ -26,12 +26,14 @@ License // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // template -void Foam::fvConstraints::constrain(fvMatrix& eqn) const +bool Foam::fvConstraints::constrain(fvMatrix& eqn) const { checkApplied(); const PtrListDictionary& constraintList(*this); + bool constrained = false; + forAll(constraintList, i) { const fvConstraint& constraint = constraintList[i]; @@ -46,14 +48,17 @@ void Foam::fvConstraints::constrain(fvMatrix& eqn) const << " to field " << eqn.psi().name() << endl; } - constraint.constrain(eqn, eqn.psi().name()); + constrained = + constrained || constraint.constrain(eqn, eqn.psi().name()); } } + + return constrained; } template -void Foam::fvConstraints::constrain +bool Foam::fvConstraints::constrain ( GeometricField& field ) const @@ -62,6 +67,8 @@ void Foam::fvConstraints::constrain const PtrListDictionary& constraintList(*this); + bool constrained = false; + forAll(constraintList, i) { const fvConstraint& constraint = constraintList[i]; @@ -76,9 +83,12 @@ void Foam::fvConstraints::constrain << " for field " << fieldName << endl; } - constraint.constrain(field); + constrained = + constrained || constraint.constrain(field); } } + + return constrained; } diff --git a/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.C b/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.C deleted file mode 100644 index f2b0a2744b..0000000000 --- a/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.C +++ /dev/null @@ -1,285 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "pressureControl.H" -#include "findRefCell.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::pressureControl::pressureControl -( - const volScalarField& p, - const volScalarField& pRef, - const volScalarField& rho, - const dictionary& dict, - const bool pRefRequired -) -: - refCell_(-1), - refValue_(0), - pMax_("pMax", dimPressure, great), - pMin_("pMin", dimPressure, 0), - limitMaxP_(false), - limitMinP_(false) -{ - bool pLimits = false; - scalar pMax = -great; - scalar pMin = great; - - // Set the reference cell and value for closed domain simulations - if (pRefRequired && setRefCell(p, pRef, dict, refCell_, refValue_)) - { - pLimits = true; - - pMax = refValue_; - pMin = refValue_; - } - - if (dict.found("pMax") && dict.found("pMin")) - { - pMax_.value() = dict.lookup("pMax"); - limitMaxP_ = true; - pMin_.value() = dict.lookup("pMin"); - limitMinP_ = true; - } - else - { - const volScalarField::Boundary& pbf = p.boundaryField(); - const volScalarField::Boundary& rhobf = rho.boundaryField(); - - scalar rhoRefMax = -great; - scalar rhoRefMin = great; - bool rhoLimits = false; - - forAll(pbf, patchi) - { - if (pbf[patchi].fixesValue()) - { - pLimits = true; - rhoLimits = true; - - pMax = max(pMax, max(pbf[patchi])); - pMin = min(pMin, min(pbf[patchi])); - - rhoRefMax = max(rhoRefMax, max(rhobf[patchi])); - rhoRefMin = min(rhoRefMin, min(rhobf[patchi])); - } - } - - reduce(rhoLimits, andOp()); - if (rhoLimits) - { - reduce(pMax, maxOp()); - reduce(pMin, minOp()); - - reduce(rhoRefMax, maxOp()); - reduce(rhoRefMin, minOp()); - } - - if (dict.found("pMax")) - { - pMax_.value() = dict.lookup("pMax"); - limitMaxP_ = true; - } - else if (dict.found("pMaxFactor")) - { - if (!pLimits) - { - FatalIOErrorInFunction(dict) - << "'pMaxFactor' specified rather than 'pMax'" << nl - << " but the corresponding reference pressure cannot" - " be evaluated from the boundary conditions." << nl - << " Please specify 'pMax' rather than 'pMaxFactor'" - << exit(FatalIOError); - } - - const scalar pMaxFactor(dict.lookup("pMaxFactor")); - pMax_.value() = pMaxFactor*pMax; - limitMaxP_ = true; - } - else if (dict.found("rhoMax")) - { - // For backward-compatibility infer the pMax from rhoMax - - IOWarningInFunction(dict) - << "'rhoMax' specified rather than 'pMax' or 'pMaxFactor'" - << nl - << " This is supported for backward-compatibility but " - "'pMax' or 'pMaxFactor' are more reliable." << endl; - - if (!pLimits) - { - FatalIOErrorInFunction(dict) - << "'rhoMax' specified rather than 'pMax'" << nl - << " but the corresponding reference pressure cannot" - " be evaluated from the boundary conditions." << nl - << " Please specify 'pMax' rather than 'rhoMax'" - << exit(FatalIOError); - } - - if (!rhoLimits) - { - FatalIOErrorInFunction(dict) - << "'rhoMax' specified rather than 'pMaxFactor'" << nl - << " but the corresponding reference density cannot" - " be evaluated from the boundary conditions." << nl - << " Please specify 'pMaxFactor' rather than 'rhoMax'" - << exit(FatalIOError); - } - - dimensionedScalar rhoMax("rhoMax", dimDensity, dict); - - pMax_.value() = max(rhoMax.value()/rhoRefMax, 1)*pMax; - limitMaxP_ = true; - } - - if (dict.found("pMin")) - { - pMin_.value() = dict.lookup("pMin"); - limitMinP_ = true; - } - else if (dict.found("pMinFactor")) - { - if (!pLimits) - { - FatalIOErrorInFunction(dict) - << "'pMinFactor' specified rather than 'pMin'" << nl - << " but the corresponding reference pressure cannot" - " be evaluated from the boundary conditions." << nl - << " Please specify 'pMin' rather than 'pMinFactor'" - << exit(FatalIOError); - } - - const scalar pMinFactor(dict.lookup("pMinFactor")); - pMin_.value() = pMinFactor*pMin; - limitMinP_ = true; - } - else if (dict.found("rhoMin")) - { - // For backward-compatibility infer the pMin from rhoMin - - IOWarningInFunction(dict) - << "'rhoMin' specified rather than 'pMin' or 'pMinFactor'" << nl - << " This is supported for backward-compatibility but" - "'pMin' or 'pMinFactor' are more reliable." << endl; - - if (!pLimits) - { - FatalIOErrorInFunction(dict) - << "'rhoMin' specified rather than 'pMin'" << nl - << " but the corresponding reference pressure cannot" - " be evaluated from the boundary conditions." << nl - << " Please specify 'pMin' rather than 'rhoMin'" - << exit(FatalIOError); - } - - if (!rhoLimits) - { - FatalIOErrorInFunction(dict) - << "'rhoMin' specified rather than 'pMinFactor'" << nl - << " but the corresponding reference density cannot" - " be evaluated from the boundary conditions." << nl - << " Please specify 'pMinFactor' rather than 'rhoMin'" - << exit(FatalIOError); - } - - dimensionedScalar rhoMin("rhoMin", dimDensity, dict); - - pMin_.value() = min(rhoMin.value()/rhoRefMin, 1)*pMin; - limitMinP_ = true; - } - } - - if (limitMaxP_ || limitMinP_) - { - Info<< "pressureControl" << nl; - - if (limitMaxP_) - { - Info<< " pMax " << pMax_.value() << nl; - } - - if (limitMinP_) - { - Info<< " pMin " << pMin_.value() << nl; - } - - Info << endl; - } -} - - -Foam::pressureControl::pressureControl -( - const volScalarField& p, - const volScalarField& rho, - const dictionary& dict, - const bool pRefRequired -) -: - pressureControl(p, p, rho, dict, pRefRequired) -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -bool Foam::pressureControl::limit(volScalarField& p) const -{ - if (limitMaxP_ || limitMinP_) - { - if (limitMaxP_) - { - const scalar pMax = max(p).value(); - - if (pMax > pMax_.value()) - { - Info<< "pressureControl: p max " << pMax << endl; - p = min(p, pMax_); - } - } - - if (limitMinP_) - { - const scalar pMin = min(p).value(); - - if (pMin < pMin_.value()) - { - Info<< "pressureControl: p min " << pMin << endl; - p = max(p, pMin_); - } - } - - p.correctBoundaryConditions(); - - return true; - } - else - { - return false; - } -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C b/src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C new file mode 100644 index 0000000000..fe73138690 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/pressureReference/pressureReference.C @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "pressureReference.H" +#include "findRefCell.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::pressureReference::pressureReference +( + const volScalarField& p, + const volScalarField& pRef, + const volScalarField& rho, + const dictionary& dict, + const bool pRefRequired +) +: + refCell_(-1), + refValue_(0) +{ + // Set the reference cell and value for closed domain simulations + if (pRefRequired) + { + setRefCell(p, pRef, dict, refCell_, refValue_); + } + + // Print update message fvSolution -> fvConstraints + if + ( + dict.found("pMin") + || dict.found("pMax") + || dict.found("pMinFactor") + || dict.found("pMaxFactor") + || dict.found("rhoMin") + || dict.found("rhoMax") + ) + { + FatalIOErrorInFunction(dict) + << "Pressure limits should now be specified in fvConstraints:\n\n" + "limitp\n" + "{\n" + " type limitPressure;\n" + "\n"; + + if (dict.found("pMin")) + { + FatalIOError + << " min " << dict.lookup("pMin") + << ";\n"; + } + + if (dict.found("pMax")) + { + FatalIOError + << " max " << dict.lookup("pMax") + << ";\n"; + } + + if (dict.found("pMinFactor")) + { + FatalIOError + << " minFactor " << dict.lookup("pMinFactor") + << ";\n"; + } + + if (dict.found("pMaxFactor")) + { + FatalIOError + << " maxFactor " << dict.lookup("pMaxFactor") + << ";\n"; + } + + FatalIOError << "}\n"; + + if + ( + dict.found("rhoMin") + || dict.found("rhoMax") + ) + { + FatalIOError + << "\nrhoMin and rhoMax are no longer supported.\n"; + } + + FatalIOError << exit(FatalIOError); + } +} + + +Foam::pressureReference::pressureReference +( + const volScalarField& p, + const volScalarField& rho, + const dictionary& dict, + const bool pRefRequired +) +: + pressureReference(p, p, rho, dict, pRefRequired) +{} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.H b/src/finiteVolume/cfdTools/general/pressureReference/pressureReference.H similarity index 78% rename from src/finiteVolume/cfdTools/general/pressureControl/pressureControl.H rename to src/finiteVolume/cfdTools/general/pressureReference/pressureReference.H index 005de474ad..ab2e7ae7a6 100644 --- a/src/finiteVolume/cfdTools/general/pressureControl/pressureControl.H +++ b/src/finiteVolume/cfdTools/general/pressureReference/pressureReference.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,21 +22,19 @@ License along with OpenFOAM. If not, see . Class - Foam::pressureControl + Foam::pressureReference Description Provides controls for the pressure reference in closed-volume simulations - and a general method for limiting the pressure during the startup of - steady-state simulations. SourceFiles - pressureControlI.H - pressureControl.C + pressureReferenceI.H + pressureReference.C \*---------------------------------------------------------------------------*/ -#ifndef pressureControl_H -#define pressureControl_H +#ifndef pressureReference_H +#define pressureReference_H #include "dimensionedScalar.H" #include "volFieldsFwd.H" @@ -47,10 +45,10 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class pressureControl Declaration + Class pressureReference Declaration \*---------------------------------------------------------------------------*/ -class pressureControl +class pressureReference { // Private Data @@ -60,18 +58,6 @@ class pressureControl //- Optional pressure reference level scalar refValue_; - //- Pressure lower-limit - dimensionedScalar pMax_; - - //- Pressure upper-limit - dimensionedScalar pMin_; - - //- Pressure lower-limit - bool limitMaxP_; - - //- Pressure upper-limit - bool limitMinP_; - public: @@ -79,7 +65,7 @@ public: //- Construct from the simple/pimple sub-dictionary // supporting the pressure and derived pressure fields (e.g. p_rgh) - pressureControl + pressureReference ( const volScalarField& p, const volScalarField& pRef, @@ -89,7 +75,7 @@ public: ); //- Construct from the simple/pimple sub-dictionary - pressureControl + pressureReference ( const volScalarField& p, const volScalarField& rho, @@ -105,9 +91,6 @@ public: //- Return the pressure reference level inline scalar refValue() const; - - //- Limit the pressure if necessary and return true if so - bool limit(volScalarField& p) const; }; @@ -117,7 +100,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "pressureControlI.H" +#include "pressureReferenceI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/cfdTools/general/pressureControl/pressureControlI.H b/src/finiteVolume/cfdTools/general/pressureReference/pressureReferenceI.H similarity index 87% rename from src/finiteVolume/cfdTools/general/pressureControl/pressureControlI.H rename to src/finiteVolume/cfdTools/general/pressureReference/pressureReferenceI.H index e1b467b516..625fb51a62 100644 --- a/src/finiteVolume/cfdTools/general/pressureControl/pressureControlI.H +++ b/src/finiteVolume/cfdTools/general/pressureReference/pressureReferenceI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,13 +25,13 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::label Foam::pressureControl::refCell() const +inline Foam::label Foam::pressureReference::refCell() const { return refCell_; } -inline Foam::scalar Foam::pressureControl::refValue() const +inline Foam::scalar Foam::pressureReference::refValue() const { return refValue_; } diff --git a/src/fvConstraints/Make/files b/src/fvConstraints/Make/files index 40e7484266..936182a578 100644 --- a/src/fvConstraints/Make/files +++ b/src/fvConstraints/Make/files @@ -1,6 +1,7 @@ fixedValueConstraint/fixedValueConstraint.C fixedTemperatureConstraint/fixedTemperatureConstraint.C limitTemperature/limitTemperature.C +limitPressure/limitPressure.C limitVelocity/limitVelocity.C meanVelocityForce/meanVelocityForce.C meanVelocityForce/patchMeanVelocityForce/patchMeanVelocityForce.C diff --git a/src/fvConstraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C b/src/fvConstraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C index 7e6dade2f5..1d7c8f91a5 100644 --- a/src/fvConstraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C +++ b/src/fvConstraints/fixedTemperatureConstraint/fixedTemperatureConstraint.C @@ -119,7 +119,7 @@ Foam::wordList Foam::fv::fixedTemperatureConstraint::constrainedFields() const } -void Foam::fv::fixedTemperatureConstraint::constrain +bool Foam::fv::fixedTemperatureConstraint::constrain ( fvMatrix& eqn, const word& fieldName @@ -151,6 +151,8 @@ void Foam::fv::fixedTemperatureConstraint::constrain break; } } + + return cells.size(); } diff --git a/src/fvConstraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H b/src/fvConstraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H index 3c494aa48d..c1cae424e7 100644 --- a/src/fvConstraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H +++ b/src/fvConstraints/fixedTemperatureConstraint/fixedTemperatureConstraint.H @@ -149,7 +149,7 @@ public: virtual wordList constrainedFields() const; //- Constrain energy equation to fix the temperature - virtual void constrain + virtual bool constrain ( fvMatrix& eqn, const word& fieldName diff --git a/src/fvConstraints/fixedValueConstraint/fixedValueConstraint.C b/src/fvConstraints/fixedValueConstraint/fixedValueConstraint.C index f92f647f09..fd6beef6b8 100644 --- a/src/fvConstraints/fixedValueConstraint/fixedValueConstraint.C +++ b/src/fvConstraints/fixedValueConstraint/fixedValueConstraint.C @@ -70,7 +70,7 @@ void Foam::fv::fixedValueConstraint::readCoeffs() template -void Foam::fv::fixedValueConstraint::constrainType +bool Foam::fv::fixedValueConstraint::constrainType ( fvMatrix& eqn, const word& fieldName @@ -83,6 +83,8 @@ void Foam::fv::fixedValueConstraint::constrainType set_.cells(), List(set_.cells().size(), fieldValues_[fieldName]->value(t)) ); + + return set_.cells().size(); } diff --git a/src/fvConstraints/fixedValueConstraint/fixedValueConstraint.H b/src/fvConstraints/fixedValueConstraint/fixedValueConstraint.H index e031b0447f..411f5ad93d 100644 --- a/src/fvConstraints/fixedValueConstraint/fixedValueConstraint.H +++ b/src/fvConstraints/fixedValueConstraint/fixedValueConstraint.H @@ -89,7 +89,7 @@ class fixedValueConstraint //- Set value on a field template - void constrainType(fvMatrix& eqn, const word& fieldName) const; + bool constrainType(fvMatrix& eqn, const word& fieldName) const; public: diff --git a/src/fvConstraints/limitPressure/limitPressure.C b/src/fvConstraints/limitPressure/limitPressure.C new file mode 100644 index 0000000000..2ba7fbf242 --- /dev/null +++ b/src/fvConstraints/limitPressure/limitPressure.C @@ -0,0 +1,222 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "limitPressure.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace fv +{ + defineTypeNameAndDebug(limitPressure, 0); + addToRunTimeSelectionTable + ( + fvConstraint, + limitPressure, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::fv::limitPressure::readCoeffs() +{ + const dictionary& dict(coeffs()); + + if (dict.found("min") && dict.found("max")) + { + pMin_.value() = dict.lookup("min"); + limitMinP_ = true; + + pMax_.value() = dict.lookup("max"); + limitMaxP_ = true; + } + else + { + const volScalarField& p = mesh().lookupObject("p"); + const volScalarField::Boundary& pbf = p.boundaryField(); + + bool pLimits = false; + scalar pMin = vGreat; + scalar pMax = -vGreat; + + forAll(pbf, patchi) + { + if (pbf[patchi].fixesValue()) + { + pLimits = true; + + pMin = min(pMin, min(pbf[patchi])); + pMax = max(pMax, max(pbf[patchi])); + } + } + + if (dict.found("min")) + { + pMin_.value() = dict.lookup("min"); + limitMinP_ = true; + } + else if (dict.found("minFactor")) + { + if (!pLimits) + { + FatalIOErrorInFunction(dict) + << "'minFactor' specified rather than 'min'" << nl + << " but the corresponding reference pressure cannot" + " be evaluated from the boundary conditions." << nl + << " Please specify 'min' rather than 'minFactor'" + << exit(FatalIOError); + } + + const scalar pMinFactor(dict.lookup("minFactor")); + pMin_.value() = pMinFactor*pMin; + limitMinP_ = true; + } + + if (dict.found("max")) + { + pMax_.value() = dict.lookup("max"); + limitMaxP_ = true; + } + else if (dict.found("maxFactor")) + { + if (!pLimits) + { + FatalIOErrorInFunction(dict) + << "'maxFactor' specified rather than 'max'" << nl + << " but the corresponding reference pressure cannot" + " be evaluated from the boundary conditions." << nl + << " Please specify 'max' rather than 'maxFactor'" + << exit(FatalIOError); + } + + const scalar pMaxFactor(dict.lookup("maxFactor")); + pMax_.value() = pMaxFactor*pMax; + limitMaxP_ = true; + } + } + + if (limitMinP_ || limitMaxP_) + { + if (limitMinP_) + { + Info<< " min " << pMin_.value() << nl; + } + + if (limitMaxP_) + { + Info<< " max " << pMax_.value() << nl; + } + + Info << endl; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fv::limitPressure::limitPressure +( + const word& name, + const word& modelType, + const dictionary& dict, + const fvMesh& mesh +) +: + fvConstraint(name, modelType, dict, mesh), + pMin_("pMin", dimPressure, 0), + pMax_("pMax", dimPressure, great), + limitMinP_(false), + limitMaxP_(false) +{ + readCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::wordList Foam::fv::limitPressure::constrainedFields() const +{ + return wordList(1, "p"); +} + + +bool Foam::fv::limitPressure::constrain(volScalarField& p) const +{ + bool constrained = false; + + if (limitMinP_ || limitMaxP_) + { + if (limitMinP_) + { + const scalar pMin = min(p).value(); + + if (pMin < pMin_.value()) + { + Info<< "limitPressure: p min " << pMin << endl; + p = max(p, pMin_); + constrained = true; + } + } + + if (limitMaxP_) + { + const scalar pMax = max(p).value(); + + if (pMax > pMax_.value()) + { + Info<< "limitPressure: p max " << pMax << endl; + p = min(p, pMax_); + constrained = true; + } + } + + p.correctBoundaryConditions(); + } + + return constrained; +} + + +bool Foam::fv::limitPressure::read(const dictionary& dict) +{ + if (fvConstraint::read(dict)) + { + readCoeffs(); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/fvConstraints/limitPressure/limitPressure.H b/src/fvConstraints/limitPressure/limitPressure.H new file mode 100644 index 0000000000..0127c36bfb --- /dev/null +++ b/src/fvConstraints/limitPressure/limitPressure.H @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::fv::limitPressure + +Description + Limits the pressure to be between minimum and maximum values. + +Usage + Example usage: + \verbatim + limitp + { + type limitPressure; + + min 200; + max 500; + } + \endverbatim + +SourceFiles + limitPressure.C + +\*---------------------------------------------------------------------------*/ + +#ifndef limitPressure_H +#define limitPressure_H + +#include "fvConstraint.H" +#include "dimensionedScalar.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace fv +{ + +/*---------------------------------------------------------------------------*\ + Class limitPressure Declaration +\*---------------------------------------------------------------------------*/ + +class limitPressure +: + public fvConstraint +{ + // Private data + + //- Minimum pressure limit + dimensionedScalar pMin_; + + //- Maximum pressure limit + dimensionedScalar pMax_; + + //- Pressure min-limited + bool limitMinP_; + + //- Pressure max-limited + bool limitMaxP_; + + + // Private Member Functions + + //- Non-virtual read + void readCoeffs(); + + +public: + + //- Runtime type information + TypeName("limitPressure"); + + + // Constructors + + //- Construct from components + limitPressure + ( + const word& name, + const word& modelType, + const dictionary& dict, + const fvMesh& mesh + ); + + //- Disallow default bitwise copy construction + limitPressure(const limitPressure&) = delete; + + + //- Destructor + virtual ~limitPressure() + {} + + + // Member Functions + + //- Return the list of fields constrained by the fvConstraint + virtual wordList constrainedFields() const; + + //- Constrain the energy field + virtual bool constrain(volScalarField& he) const; + + //- Read dictionary + virtual bool read(const dictionary& dict); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const limitPressure&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace fv +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/fvConstraints/limitTemperature/limitTemperature.C b/src/fvConstraints/limitTemperature/limitTemperature.C index 12cc642d48..39494f100a 100644 --- a/src/fvConstraints/limitTemperature/limitTemperature.C +++ b/src/fvConstraints/limitTemperature/limitTemperature.C @@ -88,7 +88,7 @@ Foam::wordList Foam::fv::limitTemperature::constrainedFields() const } -void Foam::fv::limitTemperature::constrain(volScalarField& he) const +bool Foam::fv::limitTemperature::constrain(volScalarField& he) const { const basicThermo& thermo = mesh().lookupObject @@ -137,6 +137,8 @@ void Foam::fv::limitTemperature::constrain(volScalarField& he) const } } } + + return cells.size(); } diff --git a/src/fvConstraints/limitTemperature/limitTemperature.H b/src/fvConstraints/limitTemperature/limitTemperature.H index bf0ff27c51..e5cd8b533c 100644 --- a/src/fvConstraints/limitTemperature/limitTemperature.H +++ b/src/fvConstraints/limitTemperature/limitTemperature.H @@ -122,7 +122,7 @@ public: virtual wordList constrainedFields() const; //- Constrain the energy field - virtual void constrain(volScalarField& he) const; + virtual bool constrain(volScalarField& he) const; //- Update for mesh changes virtual void updateMesh(const mapPolyMesh&); diff --git a/src/fvConstraints/limitVelocity/limitVelocity.C b/src/fvConstraints/limitVelocity/limitVelocity.C index aa2a466e80..e68d001cbc 100644 --- a/src/fvConstraints/limitVelocity/limitVelocity.C +++ b/src/fvConstraints/limitVelocity/limitVelocity.C @@ -80,7 +80,7 @@ Foam::wordList Foam::fv::limitVelocity::constrainedFields() const } -void Foam::fv::limitVelocity::constrain(volVectorField& U) const +bool Foam::fv::limitVelocity::constrain(volVectorField& U) const { const scalar maxSqrU = sqr(max_); @@ -123,6 +123,8 @@ void Foam::fv::limitVelocity::constrain(volVectorField& U) const } } } + + return cells.size(); } diff --git a/src/fvConstraints/limitVelocity/limitVelocity.H b/src/fvConstraints/limitVelocity/limitVelocity.H index 4fddec8ecc..dec7b4f807 100644 --- a/src/fvConstraints/limitVelocity/limitVelocity.H +++ b/src/fvConstraints/limitVelocity/limitVelocity.H @@ -116,7 +116,7 @@ public: virtual wordList constrainedFields() const; //- Constrain the velocity field - virtual void constrain(volVectorField& U) const; + virtual bool constrain(volVectorField& U) const; //- Update for mesh changes virtual void updateMesh(const mapPolyMesh&); diff --git a/src/fvConstraints/meanVelocityForce/meanVelocityForce.C b/src/fvConstraints/meanVelocityForce/meanVelocityForce.C index 02ce24388e..fc0dbaa4bd 100644 --- a/src/fvConstraints/meanVelocityForce/meanVelocityForce.C +++ b/src/fvConstraints/meanVelocityForce/meanVelocityForce.C @@ -149,7 +149,7 @@ Foam::scalar Foam::fv::meanVelocityForce::magUbarAve } -void Foam::fv::meanVelocityForce::constrain +bool Foam::fv::meanVelocityForce::constrain ( fvMatrix& eqn, const word& fieldName @@ -201,10 +201,12 @@ void Foam::fv::meanVelocityForce::constrain gradP0_ += dGradP_; dGradP_ = 0; + + return true; } -void Foam::fv::meanVelocityForce::constrain(volVectorField& U) const +bool Foam::fv::meanVelocityForce::constrain(volVectorField& U) const { const scalarField& rAU = rAPtr_(); @@ -240,6 +242,8 @@ void Foam::fv::meanVelocityForce::constrain(volVectorField& U) const << ", pressure gradient = " << gradP << endl; writeProps(gradP); + + return true; } diff --git a/src/fvConstraints/meanVelocityForce/meanVelocityForce.H b/src/fvConstraints/meanVelocityForce/meanVelocityForce.H index 1d47370910..8ccdbe7d37 100644 --- a/src/fvConstraints/meanVelocityForce/meanVelocityForce.H +++ b/src/fvConstraints/meanVelocityForce/meanVelocityForce.H @@ -146,14 +146,14 @@ public: virtual wordList constrainedFields() const; //- Add the momentum source and set the 1/A coefficient - virtual void constrain + virtual bool constrain ( fvMatrix& eqn, const word& fieldName ) const; //- Correct the pressure gradient - virtual void constrain(volVectorField& U) const; + virtual bool constrain(volVectorField& U) const; //- Update for mesh changes virtual void updateMesh(const mapPolyMesh&); diff --git a/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/fvConstraints new file mode 100644 index 0000000000..75a1d9e1b7 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.5; + maxFactor 2; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/fvSolution index 8ea69151f7..2abe102226 100644 --- a/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/fvSolution @@ -52,9 +52,6 @@ PIMPLE nOuterCorrectors 3; nCorrectors 1; nNonOrthogonalCorrectors 0; - - pMinFactor 0.5; - pMaxFactor 2.0; } relaxationFactors diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvConstraints index b639371f57..47eb2f8b55 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvConstraints +++ b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvConstraints @@ -14,11 +14,21 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +limitp +{ + type limitPressure; + + minFactor 0.1; + maxFactor 2; +} + limitT { type limitTemperature; + min 101; max 1000; + selectionMode all; } diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvSolution index a3459547fb..6dfe356caa 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/RAS/aerofoilNACA0012/system/fvSolution @@ -55,8 +55,6 @@ SIMPLE } nNonOrthogonalCorrectors 0; - pMinFactor 0.1; - pMaxFactor 2; } PIMPLE @@ -64,8 +62,6 @@ PIMPLE nCorrectors 2; nNonOrthogonalCorrectors 1; nOuterCorrectors 1; - pMinFactor 0.1; - pMaxFactor 2; } relaxationFactors diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/fvConstraints new file mode 100644 index 0000000000..3017d8614b --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.9; + maxFactor 1.5; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/fvSolution index 4cc4f03ca0..3891f50e21 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/fvSolution @@ -56,9 +56,6 @@ PIMPLE consistent yes; simpleRho yes; - pMaxFactor 1.5; - pMinFactor 0.9; - outerCorrectorResidualControl { "(U|k|epsilon)" diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/fvConstraints new file mode 100644 index 0000000000..3017d8614b --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.9; + maxFactor 1.5; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/fvSolution index d454596ba6..e54a03f1bb 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/fvSolution @@ -56,9 +56,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMaxFactor 1.5; - pMinFactor 0.9; - maxCo 0.2; rDeltaTSmoothingCoeff 0.1; rDeltaTDampingCoeff 1; diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/fvConstraints new file mode 100644 index 0000000000..363885d5c3 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.8; + maxFactor 1.2; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/fvSolution index 0bfcccad25..0cd42026ab 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/RAS/annularThermalMixer/system/fvSolution @@ -63,9 +63,6 @@ PIMPLE nOuterCorrectors 3; nCorrectors 1; nNonOrthogonalCorrectors 0; - - pMaxFactor 1.2; - pMinFactor 0.8; } relaxationFactors diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/fvConstraints new file mode 100644 index 0000000000..163b79fe65 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 0.8e5; + max 1.2e5; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/fvSolution index fae1601081..3b7fcbc229 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/fvSolution @@ -59,9 +59,6 @@ PIMPLE nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 0; - - pMax 1.2e5; - pMin 0.8e5; } diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/fvConstraints new file mode 100644 index 0000000000..163b79fe65 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 0.8e5; + max 1.2e5; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/fvSolution index 9e1378032c..dd96147c75 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/fvSolution @@ -88,9 +88,6 @@ PIMPLE nCorrectors 2; nNonOrthogonalCorrectors 0; momentumPredictor yes; - - pMax 1.2e5; - pMin 0.8e5; } relaxationFactors diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvConstraints new file mode 100644 index 0000000000..8f8c695970 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.1; + maxFactor 1.5; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvSolution index 4e599037f3..8f267817e4 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvSolution @@ -45,8 +45,6 @@ PIMPLE { nCorrectors 3; nNonOrthogonalCorrectors 0; - pMinFactor 0.1; - pMaxFactor 1.5; transonic no; consistent no; diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/fvConstraints b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/fvConstraints new file mode 100644 index 0000000000..75a1d9e1b7 --- /dev/null +++ b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.5; + maxFactor 2; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/fvSolution index 8ea69151f7..2abe102226 100644 --- a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/fvSolution @@ -52,9 +52,6 @@ PIMPLE nOuterCorrectors 3; nCorrectors 1; nNonOrthogonalCorrectors 0; - - pMinFactor 0.5; - pMaxFactor 2.0; } relaxationFactors diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvConstraints b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvConstraints new file mode 100644 index 0000000000..71ce393429 --- /dev/null +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.5; + maxFactor 1.5; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution index 948d559a34..8680b0a233 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution @@ -54,8 +54,6 @@ solvers SIMPLE { nNonOrthogonalCorrectors 0; - pMinFactor 0.5; - pMaxFactor 1.5; residualControl { diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvConstraints b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvConstraints index 1c020c812d..3744cca288 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvConstraints +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvConstraints @@ -15,6 +15,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +limitp +{ + type limitPressure; + + minFactor 0.5; + maxFactor 2; +} + source1 { type fixedTemperatureConstraint; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution index a21febf371..1c0bd7a9b1 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution @@ -48,8 +48,6 @@ SIMPLE { nUCorrectors 2; nNonOrthogonalCorrectors 0; - pMinFactor 0.5; - pMaxFactor 2.0; residualControl { diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvConstraints b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvConstraints index b639371f57..749d19340d 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvConstraints +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvConstraints @@ -14,6 +14,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +limitp +{ + type limitPressure; + + minFactor 0.1; + maxFactor 2; +} + limitT { type limitTemperature; @@ -22,4 +30,4 @@ limitT selectionMode all; } -//************************************************************************** // +// ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvSolution index f441c9fc7c..ec6c06525a 100644 --- a/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvSolution +++ b/tutorials/compressible/rhoSimpleFoam/aerofoilNACA0012/system/fvSolution @@ -43,8 +43,6 @@ SIMPLE } nNonOrthogonalCorrectors 0; - pMinFactor 0.1; - pMaxFactor 2; } relaxationFactors diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvConstraints b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvConstraints index d3cb11ebb3..5c6b0a6f98 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvConstraints +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvConstraints @@ -15,6 +15,14 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +limitp +{ + type limitPressure; + + minFactor 0.4; + maxFactor 1.5; +} + fixedTemperature { type fixedTemperatureConstraint; diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution index cd0cfaf975..4e2d75351c 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution @@ -54,8 +54,6 @@ solvers SIMPLE { nNonOrthogonalCorrectors 0; - pMinFactor 0.4; - pMaxFactor 1.5; residualControl { diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvConstraints b/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvConstraints new file mode 100644 index 0000000000..f322e2c9cc --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.1; + maxFactor 2; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution index 716ee728ca..632d783c6d 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution +++ b/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution @@ -39,8 +39,6 @@ solvers SIMPLE { nNonOrthogonalCorrectors 0; - pMinFactor 0.1; - pMaxFactor 2; transonic yes; consistent yes; diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvConstraints b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvConstraints new file mode 100644 index 0000000000..8f8c695970 --- /dev/null +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.1; + maxFactor 1.5; +} + +// ************************************************************************* // diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvSolution index 1f04f3db1f..7eedd3106e 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvSolution +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvSolution @@ -39,8 +39,6 @@ solvers SIMPLE { nNonOrthogonalCorrectors 0; - pMinFactor 0.1; - pMaxFactor 1.5; transonic no; consistent no; diff --git a/tutorials/lagrangian/reactingParticleFoam/verticalChannel/system/fvConstraints b/tutorials/lagrangian/reactingParticleFoam/verticalChannel/system/fvConstraints new file mode 100644 index 0000000000..3017d8614b --- /dev/null +++ b/tutorials/lagrangian/reactingParticleFoam/verticalChannel/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.9; + maxFactor 1.5; +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParticleFoam/verticalChannel/system/fvSolution b/tutorials/lagrangian/reactingParticleFoam/verticalChannel/system/fvSolution index ac54be9541..d98c5c1374 100644 --- a/tutorials/lagrangian/reactingParticleFoam/verticalChannel/system/fvSolution +++ b/tutorials/lagrangian/reactingParticleFoam/verticalChannel/system/fvSolution @@ -90,9 +90,6 @@ PIMPLE nCorrectors 3; nNonOrthogonalCorrectors 0; momentumPredictor yes; - - pMaxFactor 1.5; - pMinFactor 0.9; } relaxationFactors diff --git a/tutorials/lagrangian/reactingParticleFoam/verticalChannelLTS/system/fvConstraints b/tutorials/lagrangian/reactingParticleFoam/verticalChannelLTS/system/fvConstraints new file mode 100644 index 0000000000..3017d8614b --- /dev/null +++ b/tutorials/lagrangian/reactingParticleFoam/verticalChannelLTS/system/fvConstraints @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + minFactor 0.9; + maxFactor 1.5; +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/reactingParticleFoam/verticalChannelLTS/system/fvSolution b/tutorials/lagrangian/reactingParticleFoam/verticalChannelLTS/system/fvSolution index 63d987f584..113de8c71d 100644 --- a/tutorials/lagrangian/reactingParticleFoam/verticalChannelLTS/system/fvSolution +++ b/tutorials/lagrangian/reactingParticleFoam/verticalChannelLTS/system/fvSolution @@ -69,9 +69,6 @@ PIMPLE nNonOrthogonalCorrectors 0; momentumPredictor yes; - pMaxFactor 1.5; - pMinFactor 0.9; - maxCo 2.5; rDeltaTSmoothingCoeff 0.5; alphaTemp 1; diff --git a/tutorials/multiphase/multiphaseEulerFoam/LES/bubbleColumn/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/LES/bubbleColumn/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/LES/bubbleColumn/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/LES/bubbleColumn/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/LES/bubbleColumn/system/fvSolution index f9970a81b8..840a41e080 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/LES/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/LES/bubbleColumn/system/fvSolution @@ -70,8 +70,6 @@ PIMPLE nOuterCorrectors 3; nCorrectors 1; nNonOrthogonalCorrectors 0; - - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/system/fvSolution index dcb06cb4a3..ccaae68a97 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/Grossetete/system/fvSolution @@ -76,8 +76,6 @@ PIMPLE nEnergyCorrectors 1; faceMomentum yes; - - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/LBend/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/LBend/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/LBend/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/LBend/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/LBend/system/fvSolution index dbcabc0642..7066362362 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/LBend/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/LBend/system/fvSolution @@ -92,7 +92,6 @@ PIMPLE faceMomentum yes; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumn/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumn/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumn/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumn/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumn/system/fvSolution index 906fadb0de..923a7b186a 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumn/system/fvSolution @@ -71,7 +71,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/fvSolution index 6c6de9b014..b7c84f95f9 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/fvSolution @@ -81,7 +81,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/system/fvSolution index 3317818077..42736b507d 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/bubblePipe/system/fvSolution @@ -73,7 +73,6 @@ PIMPLE faceMomentum true; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/fluidisedBed/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/fluidisedBed/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/fluidisedBed/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/fluidisedBed/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/fluidisedBed/system/fvSolution index 411a34f2d7..90a987d725 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/fluidisedBed/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/fluidisedBed/system/fvSolution @@ -91,7 +91,6 @@ PIMPLE faceMomentum no; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/system/fvSolution index 454c0ca48f..82954d5d73 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/system/fvSolution @@ -68,7 +68,6 @@ PIMPLE faceMomentum yes; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/system/fvSolution index 7579cb2192..419c0eb27e 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/system/fvSolution @@ -76,7 +76,6 @@ PIMPLE faceMomentum yes; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/system/fvSolution index 89cc47d421..bbbd823cdf 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/system/fvSolution @@ -85,7 +85,6 @@ PIMPLE faceMomentum yes; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/fvSolution index 89cc47d421..bbbd823cdf 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/system/fvSolution @@ -85,7 +85,6 @@ PIMPLE faceMomentum yes; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bed/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/bed/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bed/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bed/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/bed/system/fvSolution index 3725789841..39a898ac84 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/bed/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bed/system/fvSolution @@ -62,7 +62,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumn/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumn/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumn/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumn/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumn/system/fvSolution index 3725789841..39a898ac84 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumn/system/fvSolution @@ -62,7 +62,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvSolution index 0c35ead2bb..1d963ca92b 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporating/system/fvSolution @@ -72,7 +72,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvSolution index c54587bc6e..83f80db88d 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/fvSolution @@ -69,7 +69,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnIATE/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnIATE/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnIATE/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution index 27c811fd2d..1f1ebbc098 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/bubbleColumnIATE/system/fvSolution @@ -61,7 +61,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/damBreak4phase/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/damBreak4phase/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/damBreak4phase/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/damBreak4phase/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/damBreak4phase/system/fvSolution index a91cf4d508..3b7e92d86a 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/damBreak4phase/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/damBreak4phase/system/fvSolution @@ -78,7 +78,6 @@ PIMPLE nCorrectors 3; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/fluidisedBed/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/fluidisedBed/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/fluidisedBed/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/fluidisedBed/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/fluidisedBed/system/fvSolution index 411a34f2d7..90a987d725 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/fluidisedBed/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/fluidisedBed/system/fvSolution @@ -91,7 +91,6 @@ PIMPLE faceMomentum no; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/injection/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/injection/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/injection/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/injection/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/injection/system/fvSolution index 3725789841..39a898ac84 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/injection/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/injection/system/fvSolution @@ -62,7 +62,6 @@ PIMPLE nCorrectors 1; nNonOrthogonalCorrectors 0; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVesselAMI2D/0/alpha.map b/tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVesselAMI2D/0/alpha.map new file mode 100644 index 0000000000..f8ebb27db1 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/mixerVesselAMI2D/0/alpha.map @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha.map; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0.6; + +boundaryField +{ + rotor + { + type calculated; + value uniform 0.6; + } + stator + { + type calculated; + value uniform 0.6; + } + front + { + type empty; + } + back + { + type empty; + } + AMI1 + { + type cyclicAMI; + value uniform 0.6; + } + AMI2 + { + type cyclicAMI; + value uniform 0.6; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/steamInjection/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/steamInjection/system/fvConstraints index 33c099b98b..b71946f218 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/steamInjection/system/fvConstraints +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/steamInjection/system/fvConstraints @@ -15,6 +15,13 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +limitp +{ + type limitPressure; + + min 1e4; +} + limitTsteam { type limitTemperature; @@ -33,5 +40,4 @@ limitTwater phase water; } - // ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/steamInjection/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/steamInjection/system/fvSolution index c9b4dcf9c5..7de74ed14e 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/steamInjection/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/steamInjection/system/fvSolution @@ -84,8 +84,6 @@ PIMPLE nEnergyCorrectors 2; faceMomentum yes; - - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/fvSolution index 9ccae2ae26..f01b776781 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/system/fvSolution @@ -87,7 +87,6 @@ PIMPLE faceMomentum yes; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/fvSolution index 9ccae2ae26..f01b776781 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/system/fvSolution @@ -87,7 +87,6 @@ PIMPLE faceMomentum yes; - pMin 1e4; } relaxationFactors diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/trickleBed/system/fvConstraints b/tutorials/multiphase/multiphaseEulerFoam/laminar/trickleBed/system/fvConstraints new file mode 100644 index 0000000000..ad541e0c87 --- /dev/null +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/trickleBed/system/fvConstraints @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvConstraints; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +limitp +{ + type limitPressure; + + min 1e4; +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/trickleBed/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/laminar/trickleBed/system/fvSolution index be11c2b0cc..422136dab4 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/trickleBed/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/trickleBed/system/fvSolution @@ -64,7 +64,6 @@ PIMPLE partialElimination true; - pMin 1e4; } relaxationFactors