Commit a9747b90 authored by sergio's avatar sergio Committed by Andrew Heather
Browse files

ENH: Correcting order of the compressibleContErr.H in comp solvers.

Adding pMin,Pmax pressure control to buoyantPimple and
chtMultiReagion
parent e05b85fa
......@@ -85,8 +85,6 @@ else
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
// Explicitly relax pressure for momentum corrector
p.relax();
......@@ -102,6 +100,10 @@ if (pressureControl.limit(p))
}
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
rho = thermo.rho();
// Correct rhoUf if the mesh is moving
......
......@@ -44,6 +44,7 @@ Description
#include "radiationModel.H"
#include "fvOptions.H"
#include "pimpleControl.H"
#include "pressureControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -35,6 +35,7 @@ volVectorField U
#include "compressibleCreatePhi.H"
pressureControl pressureControl(p, rho, pimple.dict(), false);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
......@@ -104,3 +105,7 @@ dimensionedScalar initialMass("initialMass", fvc::domainIntegrate(rho));
#include "createMRF.H"
#include "createRadiationModel.H"
#include "createFvOptions.H"
const dimensionedScalar rhoMax("rhoMax", dimDensity, GREAT, pimple.dict());
const dimensionedScalar rhoMin("rhoMin", dimDensity, Zero, pimple.dict());
......@@ -72,8 +72,7 @@ while (pimple.correctNonOrthogonal())
p = p_rgh + rho*gh;
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
pressureControl.limit(p);
if (p_rgh.needReference())
{
......@@ -90,16 +89,20 @@ if (p_rgh.needReference())
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/compressibility;
thermo.correctRho(psi*p - psip0);
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
rho = thermo.rho();
p_rgh = p - rho*gh;
p_rgh.correctBoundaryConditions();
}
}
else
{
thermo.correctRho(psi*p - psip0);
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
rho = thermo.rho();
if (thermo.dpdt())
......
......@@ -51,6 +51,7 @@ Description
#include "fvOptions.H"
#include "coordinateSystem.H"
#include "loopControl.H"
#include "pressureControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -25,6 +25,11 @@ PtrList<fv::options> fluidFvOptions(fluidRegions.size());
List<label> pRefCellFluid(fluidRegions.size());
List<scalar> pRefValueFluid(fluidRegions.size());
PtrList<dimensionedScalar> rhoMinFluid(fluidRegions.size());
PtrList<dimensionedScalar> rhoMaxFluid(fluidRegions.size());
PtrList<pressureControl> pressureControls(fluidRegions.size());
const uniformDimensionedVectorField& g = meshObjects::gravity::New(runTime);
// Populate fluid field pointer lists
......@@ -256,6 +261,24 @@ forAll(fluidRegions, i)
fluidRegions[i].solutionDict().subDict("PIMPLE");
pimpleDict.readIfPresent("frozenFlow", frozenFlowFluid[i]);
rhoMaxFluid.set
(
i,
new dimensionedScalar("rhoMax", dimDensity, GREAT, pimpleDict)
);
rhoMinFluid.set
(
i,
new dimensionedScalar("rhoMin", dimDensity, Zero, pimpleDict)
);
pressureControls.set
(
i,
new pressureControl(thermoFluid[i].p(), rhoFluid[i], pimpleDict, false)
);
Info<< " Adding MRF\n" << endl;
MRFfluid.set
(
......
......@@ -81,17 +81,9 @@ constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
p = p_rgh + rho*gh;
// Thermodynamic density update
//thermo.correctRho(psi*p - psip0);
}
// Solve continuity
#include "rhoEqn.H"
// Update continuity errors
#include "compressibleContinuityErrors.H"
pressureControl.limit(p);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
......@@ -110,16 +102,20 @@ if (closedVolume)
{
p += (initialMass - fvc::domainIntegrate(psi*p))
/compressibility;
thermo.correctRho(psi*p - psip0);
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
rho = thermo.rho();
p_rgh = p - rho*gh;
p_rgh.correctBoundaryConditions();
}
}
else
{
thermo.correctRho(psi*p - psip0);
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
}
#include "rhoEqn.H"
#include "compressibleContinuityErrors.H"
rho = thermo.rho();
// Update pressure time derivative if needed
......
......@@ -61,3 +61,8 @@
const label pRefCell = pRefCellFluid[i];
const scalar pRefValue = pRefValueFluid[i];
const dimensionedScalar rhoMax = rhoMaxFluid[i];
const dimensionedScalar rhoMin = rhoMinFluid[i];
const pressureControl& pressureControl = pressureControls[i];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment